helm-charts/charts/library/common/templates/lib/serviceAccount/_valuesToObject.tpl
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs f729651dbe
fix(common): Release 2.0.2 (#196)
2023-10-05 12:25:05 +02:00

23 lines
823 B
Smarty

{{/*
Convert ServiceAccount values to an object
*/}}
{{- define "bjw-s.common.lib.serviceAccount.valuesToObject" -}}
{{- $rootContext := .rootContext -}}
{{- $identifier := .id -}}
{{- $objectValues := .values -}}
{{- /* Determine and inject the serviceAccount name */ -}}
{{- $serviceAccountName := "" -}}
{{- $defaultServiceAccountName := "default" -}}
{{- if $objectValues.create -}}
{{- $defaultServiceAccountName = (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
{{- end -}}
{{- $serviceAccountName = default $defaultServiceAccountName $objectValues.name -}}
{{- $_ := set $objectValues "name" $serviceAccountName -}}
{{- $_ := set $objectValues "identifier" $identifier -}}
{{- /* Return the serviceAccount object */ -}}
{{- $objectValues | toYaml -}}
{{- end -}}