From f7972d075ed62dc23321beebd17fd21515debe94 Mon Sep 17 00:00:00 2001 From: Naseem Date: Sun, 5 Apr 2020 10:55:58 -0400 Subject: [PATCH] feat: allow image tag override While using the chart version as image tag is the sanest default, it is not uncommon to want to override this if using a custom image, or using helm to manage an in-house app running different tags across different environments. Signed-off-by: Naseem --- pkg/chartutil/create.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index b088f20ce..f26ff47c8 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -97,6 +97,8 @@ replicaCount: 1 image: repository: nginx pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart version. + tag: "" imagePullSecrets: [] nameOverride: "" @@ -262,7 +264,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http