Repository navigation
fix(nextcloud): run the pods as the chart's own service account by default #896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -481,3 +481,22 @@ app.kubernetes.io/managed-by: {{ .rootContext.Release.Service }} | |
| app.kubernetes.io/version: {{ quote . }} | ||
| {{- end }} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| The service account the Nextcloud pods run as: rbac.serviceaccount.name when | ||
| set; else nextcloud-serviceaccount when rbac.enabled is set, the previous | ||
| default, so installs that enabled rbac keep their account; else the release's | ||
| full name when the chart creates the account; else the namespace's default | ||
| account. | ||
| */}} | ||
| {{- define "nextcloud.serviceAccountName" -}} | ||
| {{- if .Values.rbac.serviceaccount.name -}} | ||
| {{- .Values.rbac.serviceaccount.name -}} | ||
| {{- else if .Values.rbac.enabled -}} | ||
| nextcloud-serviceaccount | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where this value come from?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's the default Two ways to go from here:
Which do you prefer? |
||
| {{- else if .Values.rbac.serviceaccount.create -}} | ||
| {{- include "nextcloud.fullname" . -}} | ||
| {{- else -}} | ||
| default | ||
| {{- end -}} | ||
| {{- end -}} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. One thing before I change it: the rest of the helper is an
else ifchain, and in Go templateswithcan only be followed byelseorelse with, notelse if, so the suggestion as written doesn't parse (parse error at (nextcloud/templates/_helpers.tpl:495): unexpected <if> in input, helm v4.3.1). Usingwithwould mean nesting the rest of the chain under anelse, one level deeper:Both forms render identically for all eight combinations of
rbac.enabled×create×name(run). I find the flatifchain easier to read; would you like to keep it, or should I switch to the nestedwith?