mirror of
https://github.com/twuni/docker-registry.helm.git
synced 2026-02-14 12:49:51 +00:00
When `serviceAccount.create` is `true`, this chart creates a service account. Currently, that service account will be created without an explicit namespace. This can be problematic because the Deployment resource does have an explicit namespace set. Because the ServiceAccount and Deployment (ultimately, the Pod) must coexist in the same namespace, we need to follow the same logic when setting the namespace for both. Fixes https://github.com/twuni/docker-registry.helm/issues/60.
21 lines
629 B
YAML
21 lines
629 B
YAML
{{- if .Values.serviceAccount.create -}}
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
labels:
|
|
app: {{ template "docker-registry.name" . }}
|
|
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
|
heritage: {{ .Release.Service }}
|
|
release: {{ .Release.Name }}
|
|
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
|
{{- if .Values.serviceAccount.name }}
|
|
name: {{ .Values.serviceAccount.name }}
|
|
{{- else }}
|
|
name: {{ include "docker-registry.fullname" . }}
|
|
{{- end }}
|
|
{{- if .Values.serviceAccount.annotations }}
|
|
annotations:
|
|
{{ toYaml .Values.serviceAccount.annotations | indent 4 }}
|
|
{{- end }}
|
|
{{- end -}}
|