2022-03-20 20:28:30 +00:00
|
|
|
{{/* Define the secrets */}}
|
2022-04-26 20:33:53 +00:00
|
|
|
{{- define "lychee.secrets" -}}
|
2022-03-20 20:28:30 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Secret
|
|
|
|
type: Opaque
|
|
|
|
metadata:
|
2022-04-26 20:33:53 +00:00
|
|
|
name: lychee-secrets
|
|
|
|
{{- $lycheeprevious := lookup "v1" "Secret" .Release.Namespace "lychee-secrets" }}
|
2022-03-20 20:28:30 +00:00
|
|
|
{{- $app_key := "" }}
|
|
|
|
data:
|
2022-04-26 20:33:53 +00:00
|
|
|
{{- if $lycheeprevious}}
|
|
|
|
APP_KEY: {{ index $lycheeprevious.data "APP_KEY" }}
|
2022-03-20 20:28:30 +00:00
|
|
|
{{- else }}
|
|
|
|
{{- $app_key := randAlphaNum 32 }}
|
|
|
|
APP_KEY: {{ $app_key | b64enc }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- end -}}
|