From 3b716b6d735b5a3d8d92b28d25ab8be7a9083609 Mon Sep 17 00:00:00 2001 From: Don Bowman Date: Wed, 6 Feb 2019 12:10:30 -0500 Subject: [PATCH 1/3] Add imagePullSecret to the `default` helm create template This relates to [#3529](https://github.com/helm/helm/issues/3529). It adds image.pullSecret to the default generate blank chart when the user does `helm create`. Signed-off-by: Don Bowman --- pkg/chartutil/create.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index 9af4b8f45..2577527b3 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -62,6 +62,7 @@ image: repository: nginx tag: stable pullPolicy: IfNotPresent + # pullSecret: my_secret nameOverride: "" fullnameOverride: "" @@ -189,6 +190,10 @@ spec: app.kubernetes.io/name: {{ include ".name" . }} app.kubernetes.io/instance: {{ .Release.Name }} spec: + {{- if .Values.image.pullSecret -}} + imagePullSecrets: + - name: {{ .Values.image.pullSecret }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" From d819efa48b820591e314562975cf11175cbf283a Mon Sep 17 00:00:00 2001 From: Don Bowman Date: Sat, 23 Feb 2019 17:47:44 -0500 Subject: [PATCH 2/3] Make imagePullSecrets and array, move to root level Changes as per PR https://github.com/helm/helm/pull/5271 - make imagePullSecrets be an array - move imagePullSecrets to 'root' level of Values Signed-off-by: Don Bowman --- pkg/chartutil/create.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index 2577527b3..c5bd6805e 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -62,8 +62,8 @@ image: repository: nginx tag: stable pullPolicy: IfNotPresent - # pullSecret: my_secret +imagePullSecrets: [] nameOverride: "" fullnameOverride: "" @@ -190,9 +190,9 @@ spec: app.kubernetes.io/name: {{ include ".name" . }} app.kubernetes.io/instance: {{ .Release.Name }} spec: - {{- if .Values.image.pullSecret -}} + {{- with .Values.imagePullSecrets }} imagePullSecrets: - - name: {{ .Values.image.pullSecret }} + {{- toYaml . | nindent 8 }} {{- end }} containers: - name: {{ .Chart.Name }} From e80f1735260dadb7da11ded78c77d88ab471e041 Mon Sep 17 00:00:00 2001 From: Don Bowman Date: Sat, 2 Mar 2019 10:55:38 -0500 Subject: [PATCH 3/3] Change indent of {{ with }} Signed-off-by: Don Bowman --- pkg/chartutil/create.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index c5bd6805e..10395edaa 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -190,10 +190,10 @@ spec: app.kubernetes.io/name: {{ include ".name" . }} app.kubernetes.io/instance: {{ .Release.Name }} spec: - {{- with .Values.imagePullSecrets }} + {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"