Skip to content

Commit 9b07555

Browse files
Support for tpl function in extra env values (#21)
* Support for tpl function in extra env values * Added ci tpl function test values * bump chart version up * updates to tpl test values and readme
1 parent 24ced0a commit 9b07555

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

helm/oauth2-proxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 3.3.1
2+
version: 3.3.2
33
apiVersion: v2
44
appVersion: 7.1.3
55
home: https://oauth2-proxy.github.io/oauth2-proxy/

helm/oauth2-proxy/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,17 @@ data:
178178
cert.pem: AB..==
179179
cert.key: CD..==
180180
```
181+
## Extra environment variable templating
182+
The extraEnv value supports the tpl function which evaluate strings as templates inside the deployment template.
183+
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
184+
185+
186+
```yaml
187+
...
188+
tplValue: "This is a test value for the tpl function"
189+
extraEnv:
190+
- name: TEST_ENV_VAR_1
191+
value: test_value_1
192+
- name: TEST_ENV_VAR_2
193+
value: '{{ .Values.tplValue }}'
194+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
tplValue: "This is a test value for the template function"
2+
extraEnv:
3+
- name: TEST_ENV_VAR_1
4+
value: test_value_1
5+
- name: TEST_ENV_VAR_2
6+
value: '{{ .Values.tplValue }}'

helm/oauth2-proxy/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ spec:
130130
{{- end }}
131131
{{- end }}
132132
{{- if .Values.extraEnv }}
133-
{{ toYaml .Values.extraEnv | indent 8 }}
133+
{{ tpl (toYaml .Values.extraEnv) . | indent 8 }}
134134
{{- end }}
135135
ports:
136136
- containerPort: 4180

0 commit comments

Comments
 (0)