scale-catalog/stable/hammond/8.2.0/templates/_secrets.tpl

16 lines
490 B
Smarty
Raw Permalink Normal View History

2024-07-13 07:59:30 +00:00
{{/* Define the secrets */}}
{{- define "hammond.secrets" -}}
{{- $secretName := printf "%s-secrets" (include "tc.v1.common.lib.chart.names.fullname" .) }}
{{- $hammondprevious := lookup "v1" "Secret" .Release.Namespace $secretName }}
{{- $jwt_secret := "" }}
enabled: true
data:
{{- if $hammondprevious}}
JWT_SECRET: {{ index $hammondprevious.data "JWT_SECRET" }}
{{- else }}
{{- $jwt_secret := randAlphaNum 32 }}
JWT_SECRET: {{ $jwt_secret | b64enc }}
{{- end }}
{{- end -}}