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 committed Nov 15, 2024
1 parent 2c97270 commit d050a6e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ helm delete --namespace test my-application
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| rbac.enabled | bool | `true` | Enable RBAC. |
| rbac.serviceAccount.enabled | bool | `false` | Deploy Service Account. |
| rbac.serviceAccount.enabled | bool | `true` | Deploy a Service Account. |
| rbac.serviceAccount.name | string | `{{ include "application.name" $ }}` | Service Account Name. |
| rbac.serviceAccount.additionalLabels | object | `nil` | Additional labels for Service Account. |
| rbac.serviceAccount.annotations | object | `nil` | Annotations for Service Account. |
Expand Down
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
4 changes: 2 additions & 2 deletions application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,9 @@ rbac:
# @section -- RBAC Parameters
enabled: true
serviceAccount:
# -- (bool) Deploy Service Account.
# -- (bool) Deploy a Service Account.
# @section -- RBAC Parameters
enabled: false
enabled: true
# -- (string) Service Account Name.
# @default -- `{{ include "application.name" $ }}`
# @section -- RBAC Parameters
Expand Down

0 comments on commit d050a6e

Please sign in to comment.