Create _scheduleList.tpl

This commit is contained in:
Kjeld Schouten
2024-02-07 11:41:43 +01:00
committed by GitHub
parent 3a34efc0dd
commit ec3645c437

View File

@@ -0,0 +1,18 @@
{{- define "tc.v1.common.values.schedulesList" -}}
{{- $rootCtx := . -}}
{{- range $idx, $scheduleValues := $rootCtx.Values.schedulesList -}}
{{- $name := (printf "schedules-list-%s" (toString $idx)) -}}
{{- with $scheduleValues.name -}}
{{- $name = . -}}
{{- end -}}
{{- if not (hasKey $rootCtx.Values "schedules") -}}
{{- $_ := set $rootCtx.Values "schedules" dict -}}
{{- end -}}
{{- $_ := set $rootCtx.Values.schedules $name $scheduleValues -}}
{{- end -}}
{{- end -}}