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 14c4a68
Show file tree
Hide file tree
Showing 5 changed files with 17 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"
11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Container Agent Helm Chart Changelog

This is the Container Agent Helm Chart changelog

## 100.0.1

Set custom service account even if `create` is set to `false` ([PR #5](https://github.com/CircleCI-Public/container-runner-helm-chart/pull/5))

## 100.0.0

Initial release of helm chart
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 14c4a68

Please sign in to comment.