diff --git a/Makefile b/Makefile index 39253639..3f5c12ad 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ package: debug: helm dependency update charts/onechart - helm template my+release charts/onechart/ -f values.yaml --debug + helm template my-release charts/onechart/ -f values.yaml --debug debug-cron-job: helm dependency update charts/cron-job diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 614af975..8bb77c40 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -15,4 +15,4 @@ type: library # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.4.1 diff --git a/charts/common/templates/_envFromRef.yaml b/charts/common/templates/_envFromRef.yaml index fab37586..e8543cbe 100644 --- a/charts/common/templates/_envFromRef.yaml +++ b/charts/common/templates/_envFromRef.yaml @@ -1,6 +1,6 @@ {{- define "common.envFromRef.tpl" -}} {{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets -}} -envFrom: &envFrom +envFrom: {{- if .Values.vars }} - configMapRef: name: {{ template "common.robustName" .Release.Name }} diff --git a/charts/common/templates/_volumeMountsRef.yaml b/charts/common/templates/_volumeMountsRef.yaml index 3cf1e770..44393693 100644 --- a/charts/common/templates/_volumeMountsRef.yaml +++ b/charts/common/templates/_volumeMountsRef.yaml @@ -1,6 +1,6 @@ {{- define "common.volumeMountsRef.tpl" -}} {{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets -}} -volumeMounts: &volumeMounts +volumeMounts: {{- range .Values.volumes }} {{- if not (hasPrefix "init-" .name) }} - name: {{ .name }} diff --git a/charts/cron-job/Chart.yaml b/charts/cron-job/Chart.yaml index 84d0cb9c..f71ddf79 100644 --- a/charts/cron-job/Chart.yaml +++ b/charts/cron-job/Chart.yaml @@ -19,5 +19,5 @@ version: 0.63.0 dependencies: - name: common - version: 0.4.0 + version: 0.4.1 repository: file://../common diff --git a/charts/cron-job/charts/common-0.4.0.tgz b/charts/cron-job/charts/common-0.4.0.tgz index 4d48c21a..4800e677 100644 Binary files a/charts/cron-job/charts/common-0.4.0.tgz and b/charts/cron-job/charts/common-0.4.0.tgz differ diff --git a/charts/onechart/Chart.yaml b/charts/onechart/Chart.yaml index 0a691581..3637dbe6 100644 --- a/charts/onechart/Chart.yaml +++ b/charts/onechart/Chart.yaml @@ -19,5 +19,5 @@ version: 0.63.0 dependencies: - name: common - version: 0.4.0 + version: 0.4.1 repository: file://../common diff --git a/charts/onechart/charts/common-0.4.0.tgz b/charts/onechart/charts/common-0.4.0.tgz index 4d48c21a..2947d2e0 100644 Binary files a/charts/onechart/charts/common-0.4.0.tgz and b/charts/onechart/charts/common-0.4.0.tgz differ diff --git a/charts/onechart/templates/deployment.yaml b/charts/onechart/templates/deployment.yaml index f4eca98f..70205d6e 100644 --- a/charts/onechart/templates/deployment.yaml +++ b/charts/onechart/templates/deployment.yaml @@ -78,7 +78,7 @@ spec: {{- end }} containers: - name: {{ template "robustName" .Release.Name }} - securityContext: &securityContext + securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} @@ -133,7 +133,8 @@ spec: {{- end }} {{- if .Values.sidecar }} - name: {{ template "robustName" .Release.Name }}-sidecar - securityContext: *securityContext + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} image: {{ .Values.sidecar.repository }}:{{ .Values.sidecar.tag }} {{- if .Values.sidecar.command }} command: @@ -141,12 +142,8 @@ spec: - -c - {{ .Values.sidecar.command | quote }} {{- end }} - {{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets }} - envFrom: *envFrom - {{- end }} - {{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} - volumeMounts: *volumeMounts - {{- end }} + {{- include "common.envFromRef.tpl" . | nindent 10 }} + {{- include "common.volumeMountsRef.tpl" . | nindent 10 }} {{- end }} {{- include "common.volumesRef.tpl" . | nindent 6 }} {{- with .Values.nodeSelector }}