{{- $operatorValues :=  index .Values "reporting-operator" -}}
{{- if $operatorValues.spec.config.tls.api.createSecret -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ $operatorValues.spec.config.tls.api.secretName }}
  labels:
    app: reporting-operator
type: Opaque
data:
  tls.crt: {{ $operatorValues.spec.config.tls.api.certificate | b64enc | quote }}
  tls.key: {{ $operatorValues.spec.config.tls.api.key | b64enc | quote }}
{{- end -}}
