Add possibility to use env file

This commit is contained in:
2021-12-01 11:53:10 +01:00
parent 6aa187af09
commit 236c783188
6 changed files with 76 additions and 10 deletions

View File

@@ -42,6 +42,21 @@ func CreateReplicaObject(name string, s compose.Service) (ret []interface{}) {
container := helm.NewContainer(name, s.Image, s.Environment, s.Labels)
for _, envfile := range s.EnvFiles {
configMap := helm.NewConfigMap(name)
if err := configMap.AddEnvFile(envfile); err != nil {
Red(err.Error())
os.Exit(2)
}
container.EnvFrom = append(container.EnvFrom, map[string]map[string]string{
"configMapRef": {
"name": configMap.Metadata.Name,
},
})
ret = append(ret, configMap)
}
container.Image = "{{ .Values." + name + ".image }}"
Values[name] = map[string]interface{}{
"image": s.Image,