{{- if .Values.prometheus.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "kube-prometheus-stack.fullname" . }}-prometheus
  namespace: {{ template "kube-prometheus-stack.namespace" . }}
  labels:
    app: {{ template "kube-prometheus-stack.name" . }}-prometheus
    app.kubernetes.io/component: prometheus
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
data:
  {{- with .Values.prometheus.prometheusSpec.thanos.objectStorageConfig }}
  {{- if and .secret (not .existingSecret) }}
  object-storage-configs.yaml: {{ toYaml .secret | b64enc | quote }}
  {{- end }}
  {{- end }}
{{- end }}
