From af4f7b47139bc718811d3331a05a62b2e7b7518f Mon Sep 17 00:00:00 2001 From: Frank Muller Date: Mon, 1 Dec 2025 13:37:08 +0100 Subject: [PATCH] Helm: Add ImagePullSecrets support to batch jobs - Added ImagePullSecrets support to deployment.yaml - Added unit tests for both the deployment.yaml --- charts/rancher-webhook/templates/deployment.yaml | 4 ++++ charts/rancher-webhook/tests/deployment_test.yaml | 9 +++++++++ charts/rancher-webhook/values.yaml | 2 ++ 3 files changed, 15 insertions(+) diff --git a/charts/rancher-webhook/templates/deployment.yaml b/charts/rancher-webhook/templates/deployment.yaml index b8a7201da..5db7a78ef 100644 --- a/charts/rancher-webhook/templates/deployment.yaml +++ b/charts/rancher-webhook/templates/deployment.yaml @@ -18,6 +18,10 @@ spec: secret: secretName: client-ca {{- end }} +{{- if .Values.imagePullSecrets }} + imagePullSecrets: +{{ toYaml .Values.imagePullSecrets | indent 6 }} + {{- end }} {{- if .Values.global.hostNetwork }} hostNetwork: true {{- end }} diff --git a/charts/rancher-webhook/tests/deployment_test.yaml b/charts/rancher-webhook/tests/deployment_test.yaml index bbd6e3044..3311af50e 100644 --- a/charts/rancher-webhook/tests/deployment_test.yaml +++ b/charts/rancher-webhook/tests/deployment_test.yaml @@ -3,6 +3,15 @@ templates: - deployment.yaml tests: + - it: should render imagePullSecrets when set + set: + imagePullSecrets: + - name: my-secret + asserts: + - contains: + path: spec.template.spec.imagePullSecrets + content: + name: my-secret - it: should set webhook default port values asserts: - equal: diff --git a/charts/rancher-webhook/values.yaml b/charts/rancher-webhook/values.yaml index 541db5c46..8be02a27e 100644 --- a/charts/rancher-webhook/values.yaml +++ b/charts/rancher-webhook/values.yaml @@ -11,6 +11,8 @@ global: mcm: enabled: true +imagePullSecrets: [] + # tolerations for the webhook deployment. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ for more info tolerations: [] nodeSelector: {}