Skip to content

Commit

Permalink
Use the custom service account name if present, even if serviceAccoun…
Browse files Browse the repository at this point in the history
…t.create

is set to false
  • Loading branch information
Stuart133 committed Dec 7, 2022
1 parent 52f81d6 commit 1fe503f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ description: For deploying a CircleCI Container Agent
icon: https://raw.githubusercontent.com/circleci/media/master/logo/build/horizontal_dark.1.png
type: application

version: "100.0.0"
version: "100.0.1"
appVersion: "3"
4 changes: 4 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ app.kubernetes.io/instance: {{ .Release.Name }}
RBAC names
*/}}
{{- define "container-agent.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "container-agent.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name}}
{{- end }}
{{- end }}

{{- define "container-agent.roleName" -}}
Expand Down
2 changes: 0 additions & 2 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ spec:
- {{ toYaml . }}
{{- end}}
{{- end }}
{{- if .Values.serviceAccount.create }}
serviceAccountName: {{ include "container-agent.serviceAccountName" . }}
{{- end }}
{{- if .Values.agent.podSecurityContext }}
securityContext: {{- toYaml .Values.agent.podSecurityContext | nindent 8 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ roleRef:
kind: ClusterRole
name: {{ include "container-agent.clusterRoleName" . }}
{{- end }} # if .Values.agent.autodetectPlatform
{{- end }} # if rbac.create
{{- end }}
{{- if .Values.logging.rbac.create }}
---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down

0 comments on commit 1fe503f

Please sign in to comment.