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
@@ -468,6 +468,10 @@ func (k *Kubernetes) Transform(komposeObject kobject.KomposeObject, opt kobject.
// 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.IsDeploymentFlag || opt.IsDaemonSetFlag || opt.IsReplicationControllerFlag {
logrus.Fatalf("Controller object cannot be specified with restart: 'on-failure'")
}
pod := k.InitPod(name, service)
objects = append(objects, pod)
} else {