Closed kerruba-milkman closed 1 week ago
Thanks for reporting this @kerruba-milkman, I'll add it to our backlog.
Apparently, there's already an helper function to get the service account name that fallbacks to the fullname in case the serviceAccount.name value is not defined. Maybe it's just a matter of referencing it inside the sa.yaml
template instead of the pulumi-kubernetes-operator.fullname
function.
Here the update version:
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "pulumi-kubernetes-operator.serviceAccountName" . }}
labels:
{{- include "pulumi-kubernetes-operator.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
EDIT: I just realized there's already an open PR for this change: https://github.com/pulumi/pulumi-kubernetes-operator/pull/530
Hello!
Issue details
Currently the helm chart uses the helper
pulumi-kubernetes-operator.fullname
to populate the service account name, but thevalues.yaml
file provide aserviceAccount.name
value that is only used if theserviceAccount.create
isfalse
.Could make sense to use the
serviceAccount.name
field as.metadata.name
in the ServiceAccount and fallback to the fullname only if theserviceAccount.name
field is empty or missing.Having to use the
fullnameOverride
value to override the name of the serviceAccount doesn't provide enought flexibility and it could be confusing having bothserviceAccount.create = true
andserviceAccount.name = "non-empty-string"
.