{{ if .Values.global.prometheus.enabled }} {{- if and .Values.prometheus.alertmanager.enabled (and (empty .Values.prometheus.alertmanager.configMapOverrideName) (empty .Values.prometheus.alertmanager.configFromSecret)) -}} apiVersion: v1 kind: ConfigMap metadata: labels: {{- include "prometheus.alertmanager.labels" . | nindent 4 }} name: {{ template "prometheus.alertmanager.fullname" . }} namespace: {{ .Release.Namespace }} data: {{- $root := . -}} {{- range $key, $value := .Values.prometheus.alertmanagerFiles }} {{- if $key | regexMatch ".*\\.ya?ml$" }} {{ $key }}: | {{ toYaml $value | default "{}" | indent 4 }} {{- else }} {{ $key }}: {{ toYaml $value | indent 4 }} {{- end }} {{- end -}} {{- end -}} {{ end }}