diff --git a/helm-toolkit/templates/utils/_joinListWithComma.tpl b/helm-toolkit/templates/utils/_joinListWithComma.tpl index 2a7c691ca6..371a795ccd 100644 --- a/helm-toolkit/templates/utils/_joinListWithComma.tpl +++ b/helm-toolkit/templates/utils/_joinListWithComma.tpl @@ -13,5 +13,6 @@ # limitations under the License. {{- define "helm-toolkit.utils.joinListWithComma" -}} -{{ range $k, $v := . }}{{ if $k }},{{ end }}{{ $v }}{{ end }} +{{- $local := dict "first" true -}} +{{- range $k, $v := . -}}{{- if not $local.first -}},{{- end -}}{{- $v -}}{{- $_ := set $local "first" false -}}{{- end -}} {{- end -}}