[bitnami/common] fix: wrong use of append function (#3566)

* [bitnami/common] fix: wrong use of append function

Signed-off-by: darteaga <darteaga@vmware.com>

* fix: indentation

Signed-off-by: darteaga <darteaga@vmware.com>
This commit is contained in:
Daniel Arteaga
2020-09-01 12:52:08 +02:00
committed by GitHub
parent 630bb00113
commit c912fd0b73
3 changed files with 21 additions and 22 deletions

View File

@@ -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

View File

@@ -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**

View File

@@ -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 -}}