diff --git a/charts/operator-wandb/charts/app/templates/_deployment.tpl b/charts/operator-wandb/charts/app/templates/_deployment.tpl index 77f86f7b..81f7784f 100644 --- a/charts/operator-wandb/charts/app/templates/_deployment.tpl +++ b/charts/operator-wandb/charts/app/templates/_deployment.tpl @@ -258,7 +258,7 @@ spec: - name: GORILLA_INTERNAL_JWT_ISSUERS value: '["https://kubernetes.default.svc.cluster.local"]' - name: GORILLA_INTERNAL_JWT_SUBJECTS - value: '["system:serviceaccount:default:{{ .Values.global.weave-trace.serviceAccountName }}"]' + value: '["system:serviceaccount:default:{{ index .Values.global \"weave-trace\" \"serviceAccountName\" }}"]' {{- end }} {{- include "app.extraEnv" (dict "global" $.Values.global "local" .Values) | nindent 12 }} {{- include "wandb.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }} diff --git a/charts/operator-wandb/charts/weave-trace/templates/serviceaccount.yaml b/charts/operator-wandb/charts/weave-trace/templates/serviceaccount.yaml index fbe27b28..7f13fe6c 100644 --- a/charts/operator-wandb/charts/weave-trace/templates/serviceaccount.yaml +++ b/charts/operator-wandb/charts/weave-trace/templates/serviceaccount.yaml @@ -1,4 +1,7 @@ {{- if .Values.serviceAccount.create -}} +{{- if (empty .Values.global.weave-trace.serviceAccountName) -}} +{{- fail "Values.global.weave-trace.serviceAccountName cannot be empty if serviceAccount.create is true" -}} +{{- end -}} apiVersion: v1 kind: ServiceAccount metadata: