From 164a617869811aafe95c5290d3895984c43f2d43 Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Wed, 23 Oct 2024 16:17:01 +0200 Subject: [PATCH] fix(values): Remove tplString in environment directive We badly set a "tpl string" in values.yaml file for "values" labels set in compose.yaml file. --- generator/configMap.go | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/generator/configMap.go b/generator/configMap.go index 9c13bf8..3d81c2e 100644 --- a/generator/configMap.go +++ b/generator/configMap.go @@ -94,23 +94,20 @@ func NewConfigMap(service types.ServiceConfig, appName string, forFile bool) *Co done[value] = true continue } - val := utils.TplValue(service.Name, "environment."+value) - service.Environment[value] = &val } - if forFile { + if !forFile { // do not bind env variables to the configmap - return cm - } - // remove the variables that are already defined in the environment - if l, ok := service.Labels[LabelMapEnv]; ok { - envmap, err := labelStructs.MapEnvFrom(l) - if err != nil { - log.Fatal("Error parsing map-env", err) - } - for key, value := range envmap { - cm.AddData(key, strings.ReplaceAll(value, "__APP__", appName)) - done[key] = true + // remove the variables that are already defined in the environment + if l, ok := service.Labels[LabelMapEnv]; ok { + envmap, err := labelStructs.MapEnvFrom(l) + if err != nil { + log.Fatal("Error parsing map-env", err) + } + for key, value := range envmap { + cm.AddData(key, strings.ReplaceAll(value, "__APP__", appName)) + done[key] = true + } } } for key, env := range service.Environment {