Skip to content

Commit 861d965

Browse files
committed
tests for env vars
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent 1dfb6bf commit 861d965

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

helm/generic-helm-chart/tests/deployment_test.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,49 @@ tests:
105105
name: MY_VAR
106106
value: "my-value"
107107

108+
- it: should add env var from secret reference
109+
documentSelector:
110+
path: kind
111+
value: Deployment
112+
set:
113+
operator.env:
114+
- name: SECRET_VAR
115+
valueFrom:
116+
secretKeyRef:
117+
name: my-secret
118+
key: password
119+
asserts:
120+
- contains:
121+
path: spec.template.spec.containers[0].env
122+
content:
123+
name: SECRET_VAR
124+
valueFrom:
125+
secretKeyRef:
126+
name: my-secret
127+
key: password
128+
129+
- it: should add multiple custom env vars
130+
documentSelector:
131+
path: kind
132+
value: Deployment
133+
set:
134+
operator.env:
135+
- name: VAR_ONE
136+
value: "one"
137+
- name: VAR_TWO
138+
value: "two"
139+
asserts:
140+
- contains:
141+
path: spec.template.spec.containers[0].env
142+
content:
143+
name: VAR_ONE
144+
value: "one"
145+
- contains:
146+
path: spec.template.spec.containers[0].env
147+
content:
148+
name: VAR_TWO
149+
value: "two"
150+
108151
- it: should mount config volume
109152
asserts:
110153
- contains:

0 commit comments

Comments
 (0)