diff --git a/bitnami/common/Chart.yaml b/bitnami/common/Chart.yaml index 91c13f68e9..572a0ced43 100644 --- a/bitnami/common/Chart.yaml +++ b/bitnami/common/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: common # Please make sure that version and appVersion are always the same. -version: 0.6.1 -appVersion: 0.6.1 +version: 0.6.2 +appVersion: 0.6.2 description: A Library Helm Chart for grouping common logic between bitnami charts. This chart is not deployable by itself. keywords: - common diff --git a/bitnami/common/README.md b/bitnami/common/README.md index 7b23b69a4d..e04391a3f4 100644 --- a/bitnami/common/README.md +++ b/bitnami/common/README.md @@ -52,7 +52,7 @@ The following table lists the helpers available in the library which are scoped | Helper identifier | Description | Expected Input | |--------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `common.images.image` | Return the proper and full image name | `dict "imageRoot" .Values.path.to.the.image "global" $`, see [ImageRoot](#imageroot) for the structure. | -| `common.images.pullSecrets` | Return the proper Docker Image Registry Secret Names | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" $` | +| `common.images.pullSecrets` | Return the proper Docker Image Registry Secret Names | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global` | **Labels** diff --git a/bitnami/common/templates/_images.tpl b/bitnami/common/templates/_images.tpl index ee6673a2dc..aafde9f3bd 100644 --- a/bitnami/common/templates/_images.tpl +++ b/bitnami/common/templates/_images.tpl @@ -17,28 +17,27 @@ Return the proper image name {{/* Return the proper Docker Image Registry Secret Names -{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" $) }} +{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }} */}} {{- define "common.images.pullSecrets" -}} -{{- if .global }} -{{- if .global.imagePullSecrets }} + {{- $pullSecrets := list }} + + {{- if .global }} + {{- range .global.imagePullSecrets -}} + {{- $pullSecrets = append $pullSecrets . -}} + {{- end -}} + {{- end -}} + + {{- range .images -}} + {{- range .pullSecrets -}} + {{- $pullSecrets = append $pullSecrets . -}} + {{- end -}} + {{- end -}} + + {{- if (not (empty $pullSecrets)) }} imagePullSecrets: - {{- range .global.imagePullSecrets }} + {{- range $pullSecrets }} - name: {{ . }} + {{- end }} {{- end }} -{{- end }} -{{- else }} -{{- $pullSecrets := list }} -{{- range .images }} - {{- if .pullSecrets }} - {{- $pullSecrets = append $pullSecrets .pullSecrets }} - {{- end }} -{{- end }} -{{- if $pullSecrets }} -imagePullSecrets: - {{- range $pullSecrets }} - - name: {{ . }} - {{- end }} -{{- end }} -{{- end -}} {{- end -}}