{{- if and .Values.alertmanager.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: alertmanager-{{ template "prometheus-operator.fullname" . }}-alertmanager
  labels:
    app: {{ template "prometheus-operator.name" . }}-alertmanager
{{ include "prometheus-operator.labels" . | indent 4 }}
data:
  alertmanager.yaml: {{ toYaml .Values.alertmanager.config | b64enc | quote }}
{{- range $key, $val := .Values.alertmanager.templateFiles }}
  {{ $key }}: {{ $val | b64enc | quote }}
{{- end }}
{{- end }}