{{- $operatorValues :=  index .Values "reporting-operator" -}}
{{- if and $operatorValues.spec.authProxy.enabled $operatorValues.spec.authProxy.authenticatedEmails.createSecret -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ $operatorValues.spec.authProxy.authenticatedEmails.secretName }}
  labels:
    app: reporting-operator
type: Opaque
data:
  emails: {{ $operatorValues.spec.authProxy.authenticatedEmails.data | b64enc | quote }}
{{- end -}}
