Expand list of variable types supported for ConfigMap generation (#1603)
This commit is contained in:
parent
ba6c3c39af
commit
9e291d0857
|
|
@ -57,18 +57,16 @@ Flatten nested config options when ConfigMap is used as ConfigTarget
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "flattenValuesForConfigMap" }}
|
{{- define "flattenValuesForConfigMap" }}
|
||||||
{{- range $key, $value := . }}
|
{{- range $key, $value := . }}
|
||||||
{{- if or (kindIs "string" $value) (kindIs "int" $value) }}
|
|
||||||
{{ $key }}: {{ $value | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if kindIs "slice" $value }}
|
{{- if kindIs "slice" $value }}
|
||||||
{{ $key }}: {{ join "," $value | quote }}
|
{{ $key }}: {{ join "," $value | quote }}
|
||||||
{{- end }}
|
{{- else if kindIs "map" $value }}
|
||||||
{{- if kindIs "map" $value }}
|
|
||||||
{{- $list := list }}
|
{{- $list := list }}
|
||||||
{{- range $subKey, $subValue := $value }}
|
{{- range $subKey, $subValue := $value }}
|
||||||
{{- $list = append $list (printf "%s:%s" $subKey $subValue) }}
|
{{- $list = append $list (printf "%s:%s" $subKey $subValue) }}
|
||||||
{{ $key }}: {{ join "," $list | quote }}
|
{{ $key }}: {{ join "," $list | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue