{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if and .Values.ruler.enabled .Values.ruler.alertmanagersConfig }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "thanos.ruler.fullname" . }}-alertmanagers-config
  namespace: {{ include "common.names.namespace" . }}
  labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
    app.kubernetes.io/component: ruler
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
data:
  alertmanagers_config.yml: |-
    {{- include "common.tplvalues.render" (dict "value" .Values.ruler.alertmanagersConfig "context" $) | b64enc | nindent 4 }}
{{- end }}
