Add recurseFlattenMap heler.
All checks were successful
ci/woodpecker/push/zigbee2mqtt Pipeline was successful
All checks were successful
ci/woodpecker/push/zigbee2mqtt Pipeline was successful
This commit is contained in:
parent
31b13c17e6
commit
edf8b8b9d6
1 changed files with 13 additions and 0 deletions
|
@ -60,3 +60,16 @@ Create the name of the service account to use
|
|||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- 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 -}}
|
||||
|
|
Loading…
Reference in a new issue