* fix issue https://github.com/kubernetes/kompose/issues/1683

* add tests, die if inputfiles not specified

* fix GetComposeFileDir function and use it

* use fixed GetComposeFileDir instead of filepath.Dir

* return error instead of fatal

* add pod configmap creation to openshift
This commit is contained in:
Tomer Zait
2024-01-02 14:48:59 -05:00
committed by GitHub
parent 63f60e66fe
commit 92ca12ae5b
10 changed files with 241 additions and 11 deletions
+8 -1
View File
@@ -325,7 +325,7 @@ func (o *OpenShift) Transform(komposeObject kobject.KomposeObject, opt kobject.C
}
}
// Generate pod only and nothing more
// Generate pod and configmap objects
if service.Restart == "no" || service.Restart == "on-failure" {
// Error out if Controller Object is specified with restart: 'on-failure'
if opt.IsDeploymentConfigFlag {
@@ -333,6 +333,13 @@ func (o *OpenShift) Transform(komposeObject kobject.KomposeObject, opt kobject.C
}
pod := o.InitPod(name, service)
objects = append(objects, pod)
if len(service.EnvFile) > 0 {
for _, envFile := range service.EnvFile {
configMap := o.InitConfigMapForEnv(name, opt, envFile)
objects = append(objects, configMap)
}
}
} else {
objects = o.CreateWorkloadAndConfigMapObjects(name, service, opt)