From 46869b3329cf6c7ee43b8b1665eba66c4646b908 Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Thu, 15 Dec 2022 14:05:43 -0600 Subject: [PATCH] Add easy way to override default container registry Signed-off-by: Pat Riehecky --- pkg/chartutil/create.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index 3a8f3cc5a..d4cc78968 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -110,6 +110,7 @@ const defaultValues = `# Default values for %s. replicaCount: 1 image: + registry: "" repository: nginx pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. @@ -308,7 +309,11 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} + {{- if .Values.image.registry }} + image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + {{- else }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http