From 04e05fcea42455e40b1b8b5cfcd00d6e0a86dd57 Mon Sep 17 00:00:00 2001
From: Pete Birley <pete@port.direct>
Date: Wed, 2 Aug 2017 08:34:46 -0500
Subject: [PATCH] Fix joinListWithComma rendering when invoked with CLI values

This PS fises a rendering erros in the joinListWithComma function
when used with values from the helm --set cli command.

From Kolla-Kubernetes: https://review.openstack.org/#/c/488513/
All Credit to: Serguei Bezverkhi

Change-Id: I013a37f5e6dec43232c6ee300be8f918f9ef554a
---
 helm-toolkit/templates/utils/_joinListWithComma.tpl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 -}}