diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index 9cea0d34..c6bf202b 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -1,5 +1,5 @@ name: oauth2-proxy -version: 3.3.1 +version: 3.3.2 apiVersion: v2 appVersion: 7.1.3 home: https://oauth2-proxy.github.io/oauth2-proxy/ diff --git a/helm/oauth2-proxy/README.md b/helm/oauth2-proxy/README.md index a3df52f5..21b9177e 100644 --- a/helm/oauth2-proxy/README.md +++ b/helm/oauth2-proxy/README.md @@ -178,3 +178,17 @@ data: cert.pem: AB..== cert.key: CD..== ``` +## Extra environment variable templating +The extraEnv value supports the tpl function which evaluate strings as templates inside the deployment template. +This is useful to pass a template string as a value to the chart's extra environment variables and to render external configuration environment values + + +```yaml +... +tplValue: "This is a test value for the tpl function" +extraEnv: + - name: TEST_ENV_VAR_1 + value: test_value_1 + - name: TEST_ENV_VAR_2 + value: '{{ .Values.tplValue }}' +``` diff --git a/helm/oauth2-proxy/ci/extra-env-tpl-values.yaml b/helm/oauth2-proxy/ci/extra-env-tpl-values.yaml new file mode 100644 index 00000000..357dba91 --- /dev/null +++ b/helm/oauth2-proxy/ci/extra-env-tpl-values.yaml @@ -0,0 +1,6 @@ +tplValue: "This is a test value for the template function" +extraEnv: + - name: TEST_ENV_VAR_1 + value: test_value_1 + - name: TEST_ENV_VAR_2 + value: '{{ .Values.tplValue }}' diff --git a/helm/oauth2-proxy/templates/deployment.yaml b/helm/oauth2-proxy/templates/deployment.yaml index f2b462b5..282471e4 100644 --- a/helm/oauth2-proxy/templates/deployment.yaml +++ b/helm/oauth2-proxy/templates/deployment.yaml @@ -130,7 +130,7 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnv }} -{{ toYaml .Values.extraEnv | indent 8 }} +{{ tpl (toYaml .Values.extraEnv) . | indent 8 }} {{- end }} ports: - containerPort: 4180