mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
23 lines
823 B
Smarty
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 -}}
|