{{- $operatorValues :=  index .Values "reporting-operator" -}}
{{- if $operatorValues.spec.config.prometheus.metricsImporter.auth.tokenSecret.create -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ $operatorValues.spec.config.prometheus.metricsImporter.auth.tokenSecret.name }}
  labels:
    app: reporting-operator
data:
  token: {{ required "Must not create an empty bearer token" $operatorValues.spec.config.prometheus.metricsImporter.auth.tokenSecret.value | b64enc | quote }}
{{- end -}}
