Closed markksuite closed 10 months ago
Current templates/secret.yaml runs Secret api on every item in secretEnv. If you have several secretEnv, for example:
secretEnv: - name: "MAIL_SERVICE_USER" value: "123" - name: "MAIL_SERVICE_PASSWORD" value: "321"
It will run run same resource two times and add only MAIL_SERVICE_PASSWORD (last) secret.
Move range loop and add "-" to avoid newlines:
{{ if .Values.secretEnv }} apiVersion: v1 kind: Secret metadata: name: {{ template "wekan.fullname" $ }}-secret type: Opaque data: {{- range $key := .Values.secretEnv -}} {{ if $key.value }} {{ $key.name | indent 2 }}: {{ $key.value | b64enc }} {{- end }} {{- end }} {{ end }}
{{ if .Values.secretEnv }} {{- range $key := .Values.secretEnv }} {{ if $key.value }} apiVersion: v1 kind: Secret metadata: name: {{ template "wekan.fullname" $ }}-secret type: Opaque data: {{ $key.name | indent 2 }}: {{ $key.value | b64enc }} {{ end }} {{- end}} {{ end }}
@markksuite
Please send PR. Thanks!
Issue
Current templates/secret.yaml runs Secret api on every item in secretEnv. If you have several secretEnv, for example:
It will run run same resource two times and add only MAIL_SERVICE_PASSWORD (last) secret.
Fix
Move range loop and add "-" to avoid newlines:
Original code: