mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
13 lines
602 B
Smarty
13 lines
602 B
Smarty
{{/*
|
|
Return a secret Object by its Identifier.
|
|
*/}}
|
|
{{- define "bjw-s.common.lib.secret.getByIdentifier" -}}
|
|
{{- $rootContext := .rootContext -}}
|
|
{{- $identifier := .id -}}
|
|
{{- $enabledSecrets := (include "bjw-s.common.lib.secret.enabledSecrets" (dict "rootContext" $rootContext) | fromYaml ) }}
|
|
|
|
{{- if (hasKey $enabledSecrets $identifier) -}}
|
|
{{- $objectValues := get $enabledSecrets $identifier -}}
|
|
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledSecrets)) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|