mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
23 lines
705 B
Smarty
23 lines
705 B
Smarty
{{/*
|
|
Return the enabled controllers.
|
|
*/}}
|
|
{{- define "bjw-s.common.lib.controller.enabledControllers" -}}
|
|
{{- $rootContext := .rootContext -}}
|
|
{{- $enabledControllers := dict -}}
|
|
|
|
{{- range $name, $controller := $rootContext.Values.controllers -}}
|
|
{{- if kindIs "map" $controller -}}
|
|
{{- /* Enable by default, but allow override */ -}}
|
|
{{- $controllerEnabled := true -}}
|
|
{{- if hasKey $controller "enabled" -}}
|
|
{{- $controllerEnabled = $controller.enabled -}}
|
|
{{- end -}}
|
|
|
|
{{- if $controllerEnabled -}}
|
|
{{- $_ := set $enabledControllers $name . -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- $enabledControllers | toYaml -}}
|
|
{{- end -}}
|