scale-catalog/stable/monica/11.3.0/templates/_appkey.tpl

18 lines
561 B
Smarty
Raw Permalink Normal View History

2024-07-13 07:59:30 +00:00
{{/*
This template generates a random appkey and ensures it persists across updates/edits to the chart
*/}}
{{- define "monica.appkey" -}}
enabled: true
{{- $basename := include "tc.v1.common.lib.chart.names.fullname" $ -}}
{{- $fetchname := printf "%s-appkey" $basename -}}
{{- $keyprevious := lookup "v1" "Secret" .Release.Namespace $fetchname }}
{{- $appkey := "" }}
data:
{{- if $keyprevious }}
appkey: {{ ( index $keyprevious.data "appkey" ) | b64dec }}
{{- else }}
{{- $appkey = randAlphaNum 32 }}
appkey: {{ $appkey }}
{{- end }}
{{- end -}}