mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
23 lines
680 B
Smarty
23 lines
680 B
Smarty
{{/*
|
|
Return the enabled configMaps.
|
|
*/}}
|
|
{{- define "bjw-s.common.lib.configMap.enabledConfigmaps" -}}
|
|
{{- $rootContext := .rootContext -}}
|
|
{{- $enabledSecrets := dict -}}
|
|
|
|
{{- range $identifier, $secret := $rootContext.Values.configMaps -}}
|
|
{{- if kindIs "map" $secret -}}
|
|
{{- /* Enable Secret by default, but allow override */ -}}
|
|
{{- $secretEnabled := true -}}
|
|
{{- if hasKey $secret "enabled" -}}
|
|
{{- $secretEnabled = $secret.enabled -}}
|
|
{{- end -}}
|
|
|
|
{{- if $secretEnabled -}}
|
|
{{- $_ := set $enabledSecrets $identifier . -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- $enabledSecrets | toYaml -}}
|
|
{{- end -}}
|