diff --git a/application/templates/cronjob.yaml b/application/templates/cronjob.yaml index 17553067..6e84378b 100644 --- a/application/templates/cronjob.yaml +++ b/application/templates/cronjob.yaml @@ -54,14 +54,8 @@ spec: annotations: {{ toYaml . | nindent 12 }} {{- end }} spec: - {{- if $.Values.rbac.enabled }} - {{- if $.Values.rbac.serviceAccount.enabled }} - {{- if $.Values.rbac.serviceAccount.name }} - serviceAccountName: {{ $.Values.rbac.serviceAccount.name }} - {{- else }} - serviceAccountName: {{ template "application.name" $ }} - {{- end }} - {{- end }} + {{- if and $.Values.rbac.enabled $.Values.rbac.serviceAccount.enabled }} + serviceAccountName: {{ default (include "application.name" $) $.Values.rbac.serviceAccount.name }} {{- end }} containers: - name: {{ $name }}