Skip to content

Commit

Permalink
fix secrets templates to use 'secret.data' for environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
qjoly committed Dec 13, 2024
1 parent eb8eb1b commit c01e48b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions charts/common/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{- if .Values.deployment.cpuLimit }}
cpu: "{{ .Values.deployment.cpuLimit }}"
{{- end }}
{{- if or (.Values.variables.nonSecret) (.Values.variables.secret) (.Values.secret.existingSecret) }}
{{- if or (.Values.variables.nonSecret) (.Values.variables.secret.data) (.Values.variables.secret.existingSecret) }}
env:
{{- if .Values.variables.nonSecret }}
{{- range $index, $value := .Values.variables.nonSecret }}
Expand All @@ -53,7 +53,7 @@ spec:
{{- end }}
{{- end }}
{{- if .Values.variables.secret }}
{{- range $index, $value := .Values.variables.secret }}
{{- range $index, $value := .Values.variables.secret.data }}
- name: {{ $index }}
valueFrom:
secretKeyRef:
Expand All @@ -62,6 +62,7 @@ spec:
{{- end }}
{{- end }}
{{- if .Values.variables.secret.existingSecret }}
toto
{{- range $index, $value := .Values.variables.secret.existingSecret }}
- name: {{ $value.envName }}
valueFrom:
Expand Down
2 changes: 1 addition & 1 deletion charts/common/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .Values.variables.secret }}
{{ if .Values.variables.secret.data }}
{{- $dot := . }}
{{- range $index, $value := .Values.variables.secret.data }}
apiVersion: v1
Expand Down
5 changes: 2 additions & 3 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---

Check failure on line 1 in charts/common/values.yaml

View workflow job for this annotation

GitHub Actions / lint

1:1 [empty-lines] too many blank lines (1 > 0)
define: &containerPort 80

Check warning on line 2 in charts/common/values.yaml

View workflow job for this annotation

GitHub Actions / lint

2:1 [document-start] missing document start "---"

Expand Down Expand Up @@ -47,8 +46,8 @@ variables:
data: {}
# user: "username"
# password: "hugepassword"
existingSecret: {}
# - name: "existing-secret"
existingSecret: []
# - name: "existing-secret-name"

Check warning on line 50 in charts/common/values.yaml

View workflow job for this annotation

GitHub Actions / lint

50:7 [comments-indentation] comment not indented like content
# key: "key"
# envName: "ENV_NAME"
# - name: another-existing-secret
Expand Down

0 comments on commit c01e48b

Please sign in to comment.