mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
22 lines
760 B
Smarty
22 lines
760 B
Smarty
{{/*
|
|
Convert Secret values to an object
|
|
*/}}
|
|
{{- define "bjw-s.common.lib.secret.valuesToObject" -}}
|
|
{{- $rootContext := .rootContext -}}
|
|
{{- $identifier := .id -}}
|
|
{{- $objectValues := .values -}}
|
|
|
|
{{- /* Determine and inject the Secret name */ -}}
|
|
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
|
|
|
{{- if $objectValues.nameOverride -}}
|
|
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
|
|
{{- else -}}
|
|
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
|
{{- end -}}
|
|
{{- $_ := set $objectValues "name" $objectName -}}
|
|
{{- $_ := set $objectValues "identifier" $identifier -}}
|
|
|
|
{{- /* Return the Secret object */ -}}
|
|
{{- $objectValues | toYaml -}}
|
|
{{- end -}}
|