TrueChartsCatalogClone/stable/kutt/6.0.23/templates/_secrets.tpl

21 lines
450 B
Smarty
Raw Normal View History

{{/* Define the secrets */}}
{{- define "kutt.secrets" -}}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: kutt-secrets
{{- $kuttprevious := lookup "v1" "Secret" .Release.Namespace "kutt-secrets" }}
{{- $jwt_secret := "" }}
data:
{{- if $kuttprevious}}
JWT_SECRET: {{ index $kuttprevious.data "JWT_SECRET" }}
{{- else }}
{{- $jwt_secret := randAlphaNum 32 }}
JWT_SECRET: {{ $jwt_secret | b64enc }}
{{- end }}
{{- end -}}