fix: common.serviceAccountName should accepts $serviceAccount

This commit is contained in:
Chi-En Wu
2020-04-23 16:35:21 +08:00
parent b5cae82278
commit 9bd8494e4f
6 changed files with 21 additions and 14 deletions

View File

@ -36,9 +36,10 @@ Create chart name and version as used by the chart label.
Create the name of the service account to use.
*/}}
{{- define "common.serviceAccountName" -}}
{{- $serviceAccount := .Values.serviceAccount | default (dict) -}}
{{- $top := first . -}}
{{- $serviceAccount := index . 1 -}}
{{- if $serviceAccount.create -}}
{{ default (include "common.fullname" .) $serviceAccount.name }}
{{ default (include "common.fullname" $top) $serviceAccount.name }}
{{- else -}}
{{ default "default" $serviceAccount.name }}
{{- end -}}