From 970170c2a15cc930b3638e3d3d64c5cc35854f91 Mon Sep 17 00:00:00 2001 From: Elisiano Petrini Date: Wed, 29 May 2019 11:30:25 +0200 Subject: [PATCH] [stable/velero] Render `extraEnvVars` even when not using credentials (#14184) * [stable/velero] Render `extraEnvVars` even when not using credentials Fixes #14130 Signed-off-by: Elisiano Petrini * [stable/velero] Chart version bump Signed-off-by: Elisiano Petrini * [stable/velero] fixed logic Signed-off-by: Elisiano Petrini --- stable/velero/Chart.yaml | 2 +- stable/velero/templates/deployment.yaml | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/stable/velero/Chart.yaml b/stable/velero/Chart.yaml index 4c5ad7bb14..e929045abc 100644 --- a/stable/velero/Chart.yaml +++ b/stable/velero/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 1.0.0 description: A Helm chart for velero name: velero -version: 2.0.2 +version: 2.0.3 home: https://github.com/heptio/velero icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png sources: diff --git a/stable/velero/templates/deployment.yaml b/stable/velero/templates/deployment.yaml index d94f955e85..a061703b53 100644 --- a/stable/velero/templates/deployment.yaml +++ b/stable/velero/templates/deployment.yaml @@ -78,22 +78,26 @@ spec: mountPath: /credentials - name: scratch mountPath: /scratch + {{- end }} + {{- if (or (and .Values.credentials.useSecret (or (eq $provider "aws") (eq $provider "gcp"))) .Values.configuration.extraEnvVars) }} env: - {{- if eq $provider "aws" }} - - name: AWS_SHARED_CREDENTIALS_FILE - {{- else }} - - name: GOOGLE_APPLICATION_CREDENTIALS {{- end }} + {{- if and .Values.credentials.useSecret (or (eq $provider "aws") (eq $provider "gcp")) }} + {{- if eq $provider "aws" }} + - name: AWS_SHARED_CREDENTIALS_FILE + {{- else }} + - name: GOOGLE_APPLICATION_CREDENTIALS + {{- end }} value: /credentials/cloud - name: VELERO_SCRATCH_DIR value: /scratch - {{ with .Values.configuration.extraEnvVars }} + {{- end }} + {{- with .Values.configuration.extraEnvVars }} {{- range $key, $value := . }} - name: {{ default "none" $key }} value: {{ default "none" $value }} {{- end }} {{- end }} - {{- end }} {{- if .Values.initContainers }} initContainers: {{- toYaml .Values.initContainers | nindent 8 }}