Skip to content

Commit

Permalink
Fix bugs in helm templates
Browse files Browse the repository at this point in the history
One in my PR, and one preexisting

Signed-off-by: Olivier Léobal <[email protected]>
  • Loading branch information
oleobal committed Jan 4, 2024
1 parent 98af314 commit 2ab8ce7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions charts/substra-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- BREAKING: Remove ServiceAccount creation from `worker.rbac.create`, putting it in a new `worker.serviceAccount.create` option
- BREAKING: Some options that would result in service account names defaulting to "default" now raise an error at rendering time. Set the name to "default" by hand to reproduce the old behavior.
- Add a new `worker.serviceAccount.name` option
- Fix "api events" services using the "worker events" service account instead of the "api events" one

## [24.0.1] - 2023-12-15

Expand Down
2 changes: 1 addition & 1 deletion charts/substra-backend/UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## unreleased

## 24.0.0
## 25.0.0

If you have set `worker.rbac.create=false`, you now need to also set `worker.serviceAccount.create=false` to preserve the same behavior.

Expand Down
4 changes: 2 additions & 2 deletions charts/substra-backend/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Return the user list
*/}}
{{- define "substra.worker.serviceAccountName" -}}
{{- if .Values.worker.serviceAccount.create -}}
{{ default (printf "%s-event" ( include "substra.fullname" .)) .Values.worker.serviceAccount.name }}
{{ default (printf "%s-worker" ( include "substra.fullname" .)) .Values.worker.serviceAccount.name }}
{{- else -}}
{{- if .Values.worker.serviceAccount.name -}}
{{ .Values.worker.serviceAccount.name }}
Expand Down Expand Up @@ -176,7 +176,7 @@ Return the user list
*/}}
{{- define "substra.api.events.serviceAccountName" -}}
{{- if .Values.api.events.serviceAccount.create -}}
{{ default (printf "%s-event" ( include "substra.fullname" .)) .Values.api.events.serviceAccount.name }}
{{ default (printf "%s-api-event" ( include "substra.fullname" .)) .Values.api.events.serviceAccount.name }}
{{- else -}}
{{- if .Values.api.events.serviceAccount.name -}}
{{ .Values.api.events.serviceAccount.name }}
Expand Down
6 changes: 3 additions & 3 deletions charts/substra-backend/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "substra.fullname" . }}-worker
name: {{ include "substra.worker.serviceAccountName" . }}
labels:
{{ include "substra.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ template "substra.name" . }}
Expand Down Expand Up @@ -60,7 +60,7 @@ roleRef:
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "substra.fullname" . }}-event
name: {{ include "substra.worker.events.serviceAccountName" . }}
labels:
{{ include "substra.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ template "substra.name" . }}
Expand Down Expand Up @@ -112,7 +112,7 @@ metadata:
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "substra.fullname" . }}-api-event
name: {{ include "substra.api.events.serviceAccountName" . }}
labels:
{{ include "substra.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ template "substra.name" . }}
Expand Down

0 comments on commit 2ab8ce7

Please sign in to comment.