Add recurseFlattenMap heler.
All checks were successful
ci/woodpecker/push/zigbee2mqtt Pipeline was successful

This commit is contained in:
Alex Manning 2023-03-03 21:01:16 +00:00
parent 31b13c17e6
commit edf8b8b9d6

View file

@ -60,3 +60,16 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }} {{- default "default" .Values.serviceAccount.name }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "recurseFlattenMap" -}}
{{- $map := first . -}}
{{- $label := last . -}}
{{- range $key, $val := $map -}}
{{- $sublabel := list $label $key | join "_" | upper -}}
{{- if kindOf $val | eq "map" -}}
{{- list $val $sublabel | include "recurseFlattenMap" -}}
{{- else -}}
{{ $sublabel }}: {{ $val | quote }}
{{ end -}}
{{- end -}}
{{- end -}}