error out if controller object is specified with "restart: on-failure"

This commit is contained in:
Abhishek
2017-01-30 17:52:36 +05:30
parent abad9b1beb
commit 1ecd32a362
6 changed files with 48 additions and 67 deletions
+4
View File
@@ -321,6 +321,10 @@ func (o *OpenShift) Transform(komposeObject kobject.KomposeObject, opt kobject.C
// Generate pod only and nothing more
if service.Restart == "no" || service.Restart == "on-failure" {
// Error out if Controller Object is specified with restart: 'on-failure'
if opt.IsDeploymentConfigFlag {
logrus.Fatalf("Controller object cannot be specified with restart: 'on-failure'")
}
pod := o.InitPod(name, service)
objects = append(objects, pod)
} else {