From b3ee44d0cb0d8a8dfb7cf70ac2341a76b0252c39 Mon Sep 17 00:00:00 2001 From: jbuns Date: Tue, 15 Jun 2021 17:23:07 +0100 Subject: [PATCH] add fix for failing helm upgrade --- .../helm/quarks/templates/service-account-hooks.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/deploy/helm/quarks/templates/service-account-hooks.yml b/deploy/helm/quarks/templates/service-account-hooks.yml index 57cdcf6f9..3ee8737a5 100644 --- a/deploy/helm/quarks/templates/service-account-hooks.yml +++ b/deploy/helm/quarks/templates/service-account-hooks.yml @@ -13,4 +13,17 @@ metadata: "helm.sh/hook": {{$hook}} "helm.sh/hook-weight": "-2" "helm.sh/hook-delete-policy": before-hook-creation +{{- if $.Values.global.image.credentials }} +imagePullSecrets: +- name: {{$hook}}-pull-secret +--- +apiVersion: v1 +kind: Secret +type: kubernetes.io/dockerconfigjson +metadata: + name: {{$hook}}-pull-secret + namespace: {{ $.Release.Namespace | quote }} +data: + .dockerconfigjson: {{ printf "{%q:{%q:{%q:%q,%q:%q,%q:%q}}}" "auths" $.Values.global.image.credentials.servername "username" $.Values.global.image.credentials.username "password" $.Values.global.image.credentials.password "auth" (printf "%s:%s" $.Values.global.image.credentials.username $.Values.global.image.credentials.password | b64enc) | b64enc }} +{{- end }} {{- end }}