helm-charts/charts/library/common/templates/lib/controller/_getByIdentifier.tpl
Bernd Schorgers 425f4428ab
fix(common): Release v3.0.3 (#291)
Co-authored-by: Gabe Cook <gabe565@gmail.com>
2024-03-13 14:26:40 +01:00

14 lines
594 B
Smarty

{{/*
Return a controller by its identifier.
*/}}
{{- define "bjw-s.common.lib.controller.getByIdentifier" -}}
{{- $rootContext := .rootContext -}}
{{- $identifier := .id -}}
{{- $enabledControllers := include "bjw-s.common.lib.controller.enabledControllers" (dict "rootContext" $rootContext) | fromYaml -}}
{{- $controllerValues := get $enabledControllers $identifier -}}
{{- if not (empty $controllerValues) -}}
{{- include "bjw-s.common.lib.controller.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $controllerValues) -}}
{{- end -}}
{{- end -}}