From 644ebe354b1b800ea39b87045b6955cd4cbb48f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Wed, 12 Jun 2024 15:20:27 +0200 Subject: [PATCH] Issue 589: Add imagePullSecrets for Helm hooks (#591) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Reinhard Nägele --- .../templates/post-install-upgrade-hooks.yaml | 6 ++++++ charts/zookeeper-operator/templates/pre-delete-hooks.yaml | 6 ++++++ charts/zookeeper-operator/values.yaml | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/charts/zookeeper-operator/templates/post-install-upgrade-hooks.yaml b/charts/zookeeper-operator/templates/post-install-upgrade-hooks.yaml index bbbe41b86..cf65604da 100644 --- a/charts/zookeeper-operator/templates/post-install-upgrade-hooks.yaml +++ b/charts/zookeeper-operator/templates/post-install-upgrade-hooks.yaml @@ -51,6 +51,12 @@ metadata: "helm.sh/hook": post-install, post-upgrade "helm.sh/hook-weight": "1" "helm.sh/hook-delete-policy": hook-succeeded, before-hook-creation, hook-failed +{{- if or .Values.global.imagePullSecrets .Values.hooks.serviceAccount.imagePullSecrets }} +imagePullSecrets: +{{- range (default .Values.global.imagePullSecrets .Values.hooks.serviceAccount.imagePullSecrets) }} + - name: {{ . }} +{{- end }} +{{- end }} --- diff --git a/charts/zookeeper-operator/templates/pre-delete-hooks.yaml b/charts/zookeeper-operator/templates/pre-delete-hooks.yaml index 77fa3895a..dc5f27e09 100644 --- a/charts/zookeeper-operator/templates/pre-delete-hooks.yaml +++ b/charts/zookeeper-operator/templates/pre-delete-hooks.yaml @@ -45,6 +45,12 @@ metadata: "helm.sh/hook": pre-delete "helm.sh/hook-weight": "1" "helm.sh/hook-delete-policy": hook-succeeded, before-hook-creation, hook-failed +{{- if or .Values.global.imagePullSecrets .Values.hooks.serviceAccount.imagePullSecrets }} +imagePullSecrets: +{{- range (default .Values.global.imagePullSecrets .Values.hooks.serviceAccount.imagePullSecrets) }} + - name: {{ . }} +{{- end }} +{{- end }} --- diff --git a/charts/zookeeper-operator/values.yaml b/charts/zookeeper-operator/values.yaml index 3830f81f0..159b1685c 100644 --- a/charts/zookeeper-operator/values.yaml +++ b/charts/zookeeper-operator/values.yaml @@ -57,6 +57,10 @@ tolerations: [] annotations: {} hooks: + ## Optionally specify an array of imagePullSecrets. Will override the global parameter if set + serviceAccount: + imagePullSecrets: [] + backoffLimit: 10 image: repository: lachlanevenson/k8s-kubectl