Skip to content

Commit 776997d

Browse files
committed
Bump chart version to v0.3.11 and enhance deployment template to improve secret handling logic
1 parent 72529ad commit 776997d

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

charts/common/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ maintainers:
55
- name: QJOLY
66
77
name: common
8-
version: v0.3.10
8+
version: v0.3.11
99
appVersion: "0"
1010
kubeVersion: ">= 1.18"
1111
home: https://github.com/RubxKube/common-charts

charts/common/templates/deployment.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ spec:
8080
key: secret
8181
{{- end }}
8282
{{- end }}
83-
{{- if or (.Values.variables.secret.existingSecret) (.Values.variables.secret.extraExistingSecrets) }}
83+
{{- if and (.Values.variables.secret.existingSecret) (.Values.variables.secret.extraExistingSecrets) }}
8484
{{- $secrets := concat .Values.variables.secret.existingSecret .Values.variables.secret.extraExistingSecrets }}
8585
{{- range $index, $value := $secrets }}
8686
- name: {{ $value.envName }}
@@ -89,8 +89,24 @@ spec:
8989
name: {{ $value.name }}
9090
key: {{ $value.key }}
9191
{{- end }}
92-
{{- end }}
93-
92+
{{- else if (.Values.variables.secret.existingSecret) -}}
93+
{{- range $index, $value := .Values.variables.secret.existingSecret }}
94+
- name: {{ $value.envName }}
95+
valueFrom:
96+
secretKeyRef:
97+
name: {{ $value.name }}
98+
key: {{ $value.key }}
99+
{{- end }}
100+
101+
{{- else if (.Values.variables.secret.extraExistingSecrets) -}}
102+
{{- range $index, $value := .Values.variables.secret.extraExistingSecrets }}
103+
- name: {{ $value.envName }}
104+
valueFrom:
105+
secretKeyRef:
106+
name: {{ $value.name }}
107+
key: {{ $value.key }}
108+
{{- end }}
109+
{{- end }}
94110
{{- end }}
95111
{{- if .Values.service.enabled }}
96112
{{- end }}

0 commit comments

Comments
 (0)