From d0d1e80df2b9e99790781a55790cf52f1a401579 Mon Sep 17 00:00:00 2001 From: Krishnadas Menon Date: Mon, 22 Jan 2024 14:32:23 +0530 Subject: [PATCH] issue-589-Added imagepullsecrets for both helm hooks in zk-operator charts Signed-off-by: Krishnadas M --- .../templates/post-install-upgrade-hooks.yaml | 6 ++++++ charts/zookeeper-operator/templates/pre-delete-hooks.yaml | 6 ++++++ charts/zookeeper-operator/values.yaml | 5 +++++ 3 files changed, 17 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..e56f54fe2 100644 --- a/charts/zookeeper-operator/values.yaml +++ b/charts/zookeeper-operator/values.yaml @@ -57,6 +57,11 @@ tolerations: [] annotations: {} hooks: + ## Optionally specify an array of imagePullSecrets. Will override the global parameter if set + serviceAccount: + imagePullSecrets: [] + # - private-registry-key + backoffLimit: 10 image: repository: lachlanevenson/k8s-kubectl