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