helm-charts/charts/library/common/templates/lib/serviceAccount/_getByIdentifier.tpl
2025-06-11 14:09:46 +00:00

12 lines
488 B
Smarty

{{/*
Return a ServiceAccount Object by its Identifier.
*/}}
{{- define "bjw-s.common.lib.serviceAccount.getByIdentifier" -}}
{{- $rootContext := .rootContext -}}
{{- $identifier := .id -}}
{{- $enabledServiceAccounts := (include "bjw-s.common.lib.serviceAccount.enabledServiceAccounts" (dict "rootContext" $rootContext) | fromYaml ) }}
{{- if (hasKey $enabledServiceAccounts $identifier) -}}
{{- get $enabledServiceAccounts $identifier | toYaml -}}
{{- end -}}
{{- end -}}