{{- $operatorValues :=  index .Values "reporting-operator" -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: reporting-operator
  labels:
    app: reporting-operator
  annotations:
{{- if and $operatorValues.spec.authProxy.enabled $operatorValues.spec.route.enabled }}
    serviceaccounts.openshift.io/oauth-redirectreference.reporting-operator: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"{{ $operatorValues.spec.route.name }}"}}'
{{- end }}
{{- if $operatorValues.spec.annotations }}
{{ toYaml $operatorValues.spec.annotations | indent 4 }}
{{- end }}
