From ca0ce66b4750745628d377617d6107c638b57693 Mon Sep 17 00:00:00 2001
From: Vincent SELLIER <vincent.sellier@softwareheritage.org>
Date: Tue, 12 Mar 2024 10:32:21 +0100
Subject: [PATCH] cluster-components: Invert the alertmanager alert routing
 logic

As only the alert matching a specific namespace are routed to the irc-relay
today, sending them to the irc relay is acceptable.
We need to remove this constraint to be able to receive global cluster
alerts like the one relative to the cluster status.
If the contraint is remove the irc relay is spammed with the Watchdog
alert. The logic need to be inverted to send all the alerts we only
want to the irc-relay

Related to swh/infra/sysadm-environment#5036
and swh/infra/sysadm-environment#5281
---
 cluster-components/templates/alertmanager-config/config.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cluster-components/templates/alertmanager-config/config.yaml b/cluster-components/templates/alertmanager-config/config.yaml
index e326426d6..4fd20ae79 100644
--- a/cluster-components/templates/alertmanager-config/config.yaml
+++ b/cluster-components/templates/alertmanager-config/config.yaml
@@ -11,7 +11,7 @@ spec:
     groupWait: 31s
     groupInterval: 120s
     repeatInterval: 12h
-    receiver: ircrelay
+    receiver: "null"
     continue: true
     routes:
       - receiver: "null"
@@ -19,7 +19,8 @@ spec:
         matchers:
         - name: "alertname"
           regex: true
-          value: "InfoInhibitor"
+          value: "InfoInhibitor|Watchdog"
+      - receiver: ircrelay
   receivers:
     - name: "null"
     - name: ircrelay
-- 
GitLab