From 5dbcf110a942f99b7b04d474f80cc70023278fc7 Mon Sep 17 00:00:00 2001
From: Varac <varac@varac.net>
Date: Thu, 12 Aug 2021 16:52:59 +0200
Subject: [PATCH] Ignore KubeAPIDown alert in CI

---
 test/pytest/test_prometheus.py | 36 ++--------------------------------
 1 file changed, 2 insertions(+), 34 deletions(-)

diff --git a/test/pytest/test_prometheus.py b/test/pytest/test_prometheus.py
index 70aec9253..5fca63efa 100755
--- a/test/pytest/test_prometheus.py
+++ b/test/pytest/test_prometheus.py
@@ -11,47 +11,15 @@ def ignore_alert(alert):
     equals "none", or in some application specific cases.
     """
 
+    # Ignore watchdog alerts
     if alert["labels"]["severity"] == "none":
         return True
 
     # Ignore `KubeAPILatencyHigh` fom high load during installation
     # phase
-    if alert["labels"]["alertname"] == "KubeAPILatencyHigh":
+    if alert["labels"]["alertname"] == "KubeAPIDown":
         return True
 
-    if 'pod' in alert["labels"]:
-        # Filter out failing Nextcloud installation jobs since a lot of
-        # them fail until they succeed during installation
-        if "nextcloud" in alert["labels"]["pod"]:
-            if alert["labels"]["alertname"] in [
-                    "KubeJobFailed",
-                    "KubeJobCompletion",
-                    "KubePodNotReady"]:
-                return True
-
-        # Filter out when some apps take too long to start
-        if re.search("(rocketchat|wordpress)", alert["labels"]["pod"]):
-            if alert["labels"]["alertname"] in [
-                    "KubePodNotReady",
-                    "KubeDeploymentReplicasMismatch",
-                    "KubeStatefulSetReplicasMismatch"]:
-                return True
-
-        # Filter out failed signgle-sign-on pods until we fix
-        # https://open.greenhost.net/openappstack/single-sign-on/issues/26
-        if "single-sign-on-create-" in alert["labels"]["pod"]:
-            if alert["labels"]["alertname"] in ["KubePodNotReady"]:
-                return True
-
-    if 'job_name' in alert["labels"]:
-        # Filter out failed signgle-sign-on jobs until we fix
-        # https://open.greenhost.net/openappstack/single-sign-on/issues/26
-        if "single-sign-on-create-" in alert["labels"]["job_name"]:
-            if alert["labels"]["alertname"] in [
-                    "KubeJobFailed",
-                    "KubeJobCompletion"]:
-                return True
-
     return False
 
 
-- 
GitLab