feat: secrets

main
Sven Ketelsen 4 years ago
parent 6203f7d7f3
commit 289f176abf

@ -13,12 +13,17 @@ data:
{{- $old_sec := lookup "v1" "Secret" .Release.Namespace $secret_name }} {{- $old_sec := lookup "v1" "Secret" .Release.Namespace $secret_name }}
# check, if a secret is already set # check, if a secret is already set
{{- if or (or (not $old_sec) (not $old_sec.data)) (not (index $old_sec.data.JWT_SECRET)) }} {{- if or (not $old_sec) (not $old_sec.data) }}
{{- if (index $old_sec.data "JWT_SECRET") }}
# if set, then use the old value
JWT_SECRET: {{ index $old_sec.data "JWT_SECRET" }}
{{ else }}
# if not set, then generate a new password # if not set, then generate a new password
JWT_SECRET: {{ randAlphaNum 32 | b64enc }} JWT_SECRET: {{ randAlphaNum 32 | b64enc }}
{{ end }}
{{ else }} {{ else }}
# if set, then use the old value # if not set, then generate a new password
JWT_SECRET: {{ index $old_sec.data "JWT_SECRET" }} JWT_SECRET: {{ randAlphaNum 32 | b64enc }}
{{ end }} {{ end }}
ADMIN_PASSWORD: "{{ .Values.connect.database.password | b64enc}}" ADMIN_PASSWORD: "{{ .Values.connect.database.password | b64enc}}"

Loading…
Cancel
Save