2022-03-14 19:18:12 +00:00
|
|
|
{{/* Define the secrets */}}
|
|
|
|
{{- define "hammond.secrets" -}}
|
2023-05-01 09:16:44 +00:00
|
|
|
{{- $secretName := printf "%s-secrets" (include "tc.v1.common.lib.chart.names.fullname" .) }}
|
|
|
|
{{- $hammondprevious := lookup "v1" "Secret" .Release.Namespace $secretName }}
|
2022-03-14 19:18:12 +00:00
|
|
|
{{- $jwt_secret := "" }}
|
2023-05-01 09:16:44 +00:00
|
|
|
enabled: true
|
2022-03-14 19:18:12 +00:00
|
|
|
data:
|
|
|
|
{{- if $hammondprevious}}
|
|
|
|
JWT_SECRET: {{ index $hammondprevious.data "JWT_SECRET" }}
|
|
|
|
{{- else }}
|
|
|
|
{{- $jwt_secret := randAlphaNum 32 }}
|
|
|
|
JWT_SECRET: {{ $jwt_secret | b64enc }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- end -}}
|