From a1cd36f55e645b7a832d2ded27dee07490a0ce96 Mon Sep 17 00:00:00 2001 From: Devin Canterberry Date: Wed, 27 Jul 2022 23:50:06 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Add=20missing=20namespace=20to?= =?UTF-8?q?=20ServiceAccount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- templates/serviceaccount.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/serviceaccount.yaml b/templates/serviceaccount.yaml index 054ef1a..6cef434 100644 --- a/templates/serviceaccount.yaml +++ b/templates/serviceaccount.yaml @@ -7,6 +7,7 @@ metadata: 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 }}