From 41f67aec7bb1b094488d2fa7b26110781d5fd463 Mon Sep 17 00:00:00 2001 From: Craig O'Donnell Date: Thu, 5 Oct 2023 14:51:25 -0400 Subject: [PATCH] Add extra env to helm template (#96) * Add extra env to helm template (cherry picked from commit fad9320ec9427d711d31dec78631124efbe718de) * Update chart/templates/replicated-deployment.yaml Co-authored-by: Craig O'Donnell (cherry picked from commit a45380d059dde248aea8884939a6d2db7ad31298) * create-release v1.5.2 * test extraEnv --------- Co-authored-by: Utwo --- .github/workflows/main.yaml | 13 +++++++++++++ chart/templates/replicated-deployment.yaml | 3 +++ chart/values.yaml.tmpl | 2 ++ 3 files changed, 18 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ee2b13bc..6a1d59ef 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -113,6 +113,19 @@ jobs: exit 1 fi + cat << EOF >> test-values.yaml + extraEnv: + - name: TEST_EXTRA_ENV + value: test-extra-env + EOF + + output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --values test-values.yaml) + + if ! echo $output | grep -q 'TEST_EXTRA_ENV'; then + printf "user-set extraEnv should exist:\n\n%s\n\n" "$output" + exit 1 + fi + create-test-release: runs-on: ubuntu-22.04 needs: [ build-and-push-e2e ] diff --git a/chart/templates/replicated-deployment.yaml b/chart/templates/replicated-deployment.yaml index dc27c3b3..1cc26404 100644 --- a/chart/templates/replicated-deployment.yaml +++ b/chart/templates/replicated-deployment.yaml @@ -49,6 +49,9 @@ spec: readOnly: true subPath: config.yaml env: + {{- with .Values.extraEnv }} + {{- toYaml . | nindent 8 }} + {{- end }} - name: REPLICATED_NAMESPACE valueFrom: fieldRef: diff --git a/chart/values.yaml.tmpl b/chart/values.yaml.tmpl index 747f4b55..ebf98483 100644 --- a/chart/values.yaml.tmpl +++ b/chart/values.yaml.tmpl @@ -43,6 +43,8 @@ service: type: ClusterIP port: 3000 +extraEnv: [] + # "integration" mode related values. integration: licenseID: ""