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