scale-catalog/stable/paperless-ngx/7.12.20/templates/_secrets.tpl
Julian Haseleu 5d1ab94342 cleanup
2024-07-14 21:54:53 +00:00

15 lines
520 B
Smarty

{{/* Define the secrets */}}
{{- define "paperlessng.secrets" -}}
{{- $secretName := (printf "%s-paperlessng-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) }}
{{- $paperlessprevious := lookup "v1" "Secret" .Release.Namespace $secretName }}
enabled: true
data:
{{- if $paperlessprevious }}
PAPERLESS_SECRET_KEY: {{ index $paperlessprevious.data "PAPERLESS_SECRET_KEY" | b64dec }}
{{- else }}
{{- $secret_key := randAlphaNum 32 }}
PAPERLESS_SECRET_KEY: {{ $secret_key }}
{{- end }}
{{- end -}}