Skip to content

Commit af4f7b4

Browse files
committed
Helm: Add ImagePullSecrets support to batch jobs
- Added ImagePullSecrets support to deployment.yaml - Added unit tests for both the deployment.yaml
1 parent d7cb8bf commit af4f7b4

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

charts/rancher-webhook/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ spec:
1818
secret:
1919
secretName: client-ca
2020
{{- end }}
21+
{{- if .Values.imagePullSecrets }}
22+
imagePullSecrets:
23+
{{ toYaml .Values.imagePullSecrets | indent 6 }}
24+
{{- end }}
2125
{{- if .Values.global.hostNetwork }}
2226
hostNetwork: true
2327
{{- end }}

charts/rancher-webhook/tests/deployment_test.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ templates:
33
- deployment.yaml
44

55
tests:
6+
- it: should render imagePullSecrets when set
7+
set:
8+
imagePullSecrets:
9+
- name: my-secret
10+
asserts:
11+
- contains:
12+
path: spec.template.spec.imagePullSecrets
13+
content:
14+
name: my-secret
615
- it: should set webhook default port values
716
asserts:
817
- equal:

charts/rancher-webhook/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ global:
1111
mcm:
1212
enabled: true
1313

14+
imagePullSecrets: []
15+
1416
# tolerations for the webhook deployment. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ for more info
1517
tolerations: []
1618
nodeSelector: {}

0 commit comments

Comments
 (0)