{{- $authhubSecret := (lookup "v1" "Secret" .Release.Namespace "authhub-secret") -}}
{{- if $authhubSecret -}}
apiVersion: v1
kind: Secret
metadata:
name: authhub-secret
namespace: {{ .Release.Namespace }}
annotations:
helm.sh/resource-policy: keep
type: Opaque
stringData:
mysql-password: {{ index $authhubSecret.data "mysql-password" | b64dec }}
{{- else -}}
apiVersion: v1
kind: Secret
metadata:
name: authhub-secret
namespace: {{ .Release.Namespace }}
annotations:
helm.sh/resource-policy: keep
type: Opaque
stringData:
mysql-password: {{ randAlphaNum 20 }}
{{- end -}}