From 48af43178719eb254f3bb864998a6b9dd727cb62 Mon Sep 17 00:00:00 2001 From: Marcel Araujo Date: Thu, 12 Dec 2024 16:49:35 +0000 Subject: [PATCH] fix(operator): feature gates map allows add empty items --- .../templates/_helpers.tpl | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/charts/opentelemetry-operator/templates/_helpers.tpl b/charts/opentelemetry-operator/templates/_helpers.tpl index 4d5cba0fd..ff4eeb9c6 100644 --- a/charts/opentelemetry-operator/templates/_helpers.tpl +++ b/charts/opentelemetry-operator/templates/_helpers.tpl @@ -154,15 +154,11 @@ The image to use for opentelemetry-operator. {{- end }} {{- define "opentelemetry-operator.featureGatesMap" -}} -{{$first := true}} -{{- range $key, $value := .Values.manager.featureGatesMap -}} - {{- if $first -}} - {{ $first = false }} - {{- else -}} - , - {{- end -}} - {{- if $value -}} - {{- $key }} - {{- end -}} +{{- $list := list -}} +{{- range $k, $v := .Values.manager.featureGatesMap -}} +{{- if $v -}} +{{- $list = append $list (printf "%s=true" $k) -}} {{- end -}} +{{- end -}} +{{ join "," $list }} {{- end }}