kompose up/down create and delete pvc

pvc will be parsed when passing objects via kube client
to create various objects.
Also while deleting pvc will be deleted.

Fixes #218
This commit is contained in:
Suraj Deshmukh
2016-10-22 09:22:57 +05:30
parent b97760a537
commit 244499667d
2 changed files with 61 additions and 33 deletions
+8 -2
View File
@@ -169,7 +169,7 @@ func (k *OpenShift) Deploy(komposeObject kobject.KomposeObject, opt kobject.Conv
//Convert komposeObject
objects := k.Transform(komposeObject, opt)
fmt.Println("We are going to create OpenShift DeploymentConfigs and Services for your Dockerized application. \n" +
fmt.Println("We are going to create OpenShift DeploymentConfigs, Services and PersistentVolumeClaims for your Dockerized application. \n" +
"If you need different kind of resources, use the 'kompose convert' and 'oc create -f' commands instead. \n")
// initialize OpenShift Client
@@ -215,9 +215,15 @@ func (k *OpenShift) Deploy(komposeObject kobject.KomposeObject, opt kobject.Conv
return err
}
logrus.Infof("Successfully created service: %s", t.Name)
case *api.PersistentVolumeClaim:
_, err := kclient.PersistentVolumeClaims(namespace).Create(t)
if err != nil {
return err
}
logrus.Infof("Successfully created persistentVolumeClaim: %s", t.Name)
}
}
fmt.Println("\nYour application has been deployed to OpenShift. You can run 'oc get dc,svc,is' for details.")
fmt.Println("\nYour application has been deployed to OpenShift. You can run 'oc get dc,svc,is,pvc' for details.")
return nil
}