From d4f89f60c9d6cbc9f5adb980c61280b5d7b45814 Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Fri, 6 May 2022 15:14:57 +0200 Subject: [PATCH] Remove label "env-to-services" Deprecated and really complex to manage with the new mapenv label. --- helm/container.go | 15 ++++----------- helm/labels.go | 2 -- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/helm/container.go b/helm/container.go index 9bfa370..f202a0c 100644 --- a/helm/container.go +++ b/helm/container.go @@ -51,7 +51,10 @@ func NewContainer(name, image string, environment types.MappingWithEquals, label // warn, it's deprecated now logger.ActivateColors = true logger.Yellowf( - "[deprecated] in \"%s\" service: label %s is deprecated, please use %s instead\n", + "[deprecated] in \"%s\" service: label %s is deprecated and **ignored**, please use %s instead\n"+ + "e.g.\n"+ + " labels:\n"+ + " FOO: {{ .Release.Name }}-fooservice\n", name, LABEL_ENV_SERVICE, LABEL_MAP_ENV, @@ -59,15 +62,5 @@ func NewContainer(name, image string, environment types.MappingWithEquals, label logger.ActivateColors = false } - idx := 0 - for n, v := range environment { - for _, name := range toServices { - if name == n { - *v = ReleaseNameTpl + "-" + *v - } - } - container.Env[idx] = &Value{Name: n, Value: v} - idx++ - } return container } diff --git a/helm/labels.go b/helm/labels.go index 6fd824d..4b07921 100644 --- a/helm/labels.go +++ b/helm/labels.go @@ -40,12 +40,10 @@ func GetLabelsDocumentation() string { {{ printf "%-35s" ""}}- "http://[not used address][:port][/path]" to specify an http healthcheck {{ printf "%-35s" ""}}- "tcp://[not used address]:port" to specify a tcp healthcheck {{ printf "%-35s" ""}}- other string is condidered as a "command" healthcheck -{{.LABEL_ENV_SERVICE | printf "%-33s"}}: DEPRECATED use {{ .LABEL_MAP_ENV }} instead - specifies that the environment variable points on a service name (coma separated) `) buff := bytes.NewBuffer(nil) t.Execute(buff, map[string]string{ "LABEL_ENV_SECRET": LABEL_ENV_SECRET, - "LABEL_ENV_SERVICE": LABEL_ENV_SERVICE, "LABEL_PORT": LABEL_PORT, "LABEL_INGRESS": LABEL_INGRESS, "LABEL_VOL_CM": LABEL_VOL_CM,