forked from LaconicNetwork/kompose
Added warning after PVC creation
Partially resolve #376 and #345 Added warning, such that PV should be created before PVC or if dynamic provision is there, no need to create PV.
This commit is contained in:
@@ -61,6 +61,9 @@ type Kubernetes struct {
|
|||||||
// used when undeploying resources from kubernetes
|
// used when undeploying resources from kubernetes
|
||||||
const TIMEOUT = 300
|
const TIMEOUT = 300
|
||||||
|
|
||||||
|
//default size of Persistent Volume Claim
|
||||||
|
const PVCRequestSize = "100Mi"
|
||||||
|
|
||||||
// list of all unsupported keys for this transformer
|
// list of all unsupported keys for this transformer
|
||||||
// Keys are names of variables in kobject struct.
|
// Keys are names of variables in kobject struct.
|
||||||
// this is map to make searching for keys easier
|
// this is map to make searching for keys easier
|
||||||
@@ -242,7 +245,7 @@ func (k *Kubernetes) initIngress(name string, service kobject.ServiceConfig, por
|
|||||||
|
|
||||||
// CreatePVC initializes PersistentVolumeClaim
|
// CreatePVC initializes PersistentVolumeClaim
|
||||||
func (k *Kubernetes) CreatePVC(name string, mode string) (*api.PersistentVolumeClaim, error) {
|
func (k *Kubernetes) CreatePVC(name string, mode string) (*api.PersistentVolumeClaim, error) {
|
||||||
size, err := resource.ParseQuantity("100Mi")
|
size, err := resource.ParseQuantity(PVCRequestSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "resource.ParseQuantity failed, Error parsing size")
|
return nil, errors.Wrap(err, "resource.ParseQuantity failed, Error parsing size")
|
||||||
}
|
}
|
||||||
@@ -671,7 +674,7 @@ func (k *Kubernetes) Deploy(komposeObject kobject.KomposeObject, opt kobject.Con
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Infof("Successfully created PersistentVolumeClaim: %s", t.Name)
|
log.Infof("Successfully created PersistentVolumeClaim: %s of size %s. If your cluster has dynamic storage provisioning, you don't have to do anything. Otherwise you have to create PersistentVolume to make PVC work", t.Name, PVCRequestSize)
|
||||||
case *extensions.Ingress:
|
case *extensions.Ingress:
|
||||||
_, err := client.Ingress(namespace).Create(t)
|
_, err := client.Ingress(namespace).Create(t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ func (o *OpenShift) Deploy(komposeObject kobject.KomposeObject, opt kobject.Conv
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Infof("Successfully created PersistentVolumeClaim: %s", t.Name)
|
log.Infof("Successfully created PersistentVolumeClaim: %s of size %s. If your cluster has dynamic storage provisioning, you don't have to do anything. Otherwise you have to create PersistentVolume to make PVC work", t.Name, kubernetes.PVCRequestSize)
|
||||||
case *routeapi.Route:
|
case *routeapi.Route:
|
||||||
_, err := oclient.Routes(namespace).Create(t)
|
_, err := oclient.Routes(namespace).Create(t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user