{{- $secret := (lookup "v1" "Secret" .Release.Namespace .Values.redash.system.admin.secret ) -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ .Values.redash.system.admin.secret }}
type: Opaque
data:
{{- if $secret }}
{{ $secret.data | toYaml | nindent 2 }}
{{- else }}
{{- $generateUuid := uuidv4 }}
{{- $email := (print $generateUuid "@mail.com") }}
  email: {{ $email | b64enc }}
  password: {{ randAlphaNum 20 | b64enc }}
{{- end }}