Skip to content

Commit

Permalink
fix: allow disabling custom service accounts
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
aslafy-z authored Nov 15, 2024
1 parent 2c97270 commit 404acc5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
8 changes: 2 additions & 6 deletions application/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ spec:
annotations: {{ toYaml . | nindent 12 }}
{{- end }}
spec:
{{- if $.Values.rbac.enabled }}
{{- if $.Values.rbac.serviceAccount.name }}
serviceAccountName: {{ $.Values.rbac.serviceAccount.name }}
{{- else }}
serviceAccountName: {{ template "application.name" $ }}
{{- end }}
{{- if and $.Values.rbac.enabled $.Values.rbac.serviceAccount.enabled }}
serviceAccountName: {{ default (include "application.name" $) $.Values.rbac.serviceAccount.name }}
{{- end }}
containers:
- name: {{ $name }}
Expand Down
8 changes: 2 additions & 6 deletions application/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,8 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.rbac.serviceAccount.enabled }}
{{- if .Values.rbac.serviceAccount.name }}
serviceAccountName: {{ .Values.rbac.serviceAccount.name }}
{{- else }}
serviceAccountName: {{ template "application.name" $ }}
{{- end }}
{{- if and .Values.rbac.enabled .Values.rbac.serviceAccount.enabled }}
serviceAccountName: {{ default (include "application.name" .) .Values.rbac.serviceAccount.name }}
{{- end }}
{{- if .Values.deployment.hostNetwork }}
hostNetwork: {{ .Values.deployment.hostNetwork }}
Expand Down
8 changes: 2 additions & 6 deletions application/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ spec:
annotations: {{ toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if $.Values.rbac.enabled }}
{{- if $.Values.rbac.serviceAccount.name }}
serviceAccountName: {{ $.Values.rbac.serviceAccount.name }}
{{- else }}
serviceAccountName: {{ template "application.name" $ }}
{{- end }}
{{- if and $.Values.rbac.enabled $.Values.rbac.serviceAccount.enabled }}
serviceAccountName: {{ default (include "application.name" $) $.Values.rbac.serviceAccount.name }}
{{- end }}
containers:
- name: {{ $name }}
Expand Down

0 comments on commit 404acc5

Please sign in to comment.