{{- if .Values.prometheus.extraSecret.data -}}
{{- $secretName := printf "prometheus-%s-extra" (include "kube-prometheus-stack.fullname" . ) -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ default $secretName .Values.prometheus.extraSecret.name }}
  namespace: {{ template "kube-prometheus-stack.namespace" . }}
{{- if .Values.prometheus.extraSecret.annotations }}
  annotations:
{{ toYaml .Values.prometheus.extraSecret.annotations | indent 4 }}
{{- end }}
  labels:
    app: {{ template "kube-prometheus-stack.name" . }}-prometheus
    app.kubernetes.io/component: prometheus
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
data:
{{- range $key, $val := .Values.prometheus.extraSecret.data }}
  {{ $key }}: {{ $val | b64enc | quote }}
{{- end }}
{{- end }}
