-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpatch.diff
More file actions
48 lines (42 loc) · 1.84 KB
/
patch.diff
File metadata and controls
48 lines (42 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
commit 53e7703562a7371a1e720571d4e3f5c21d342878
Author: builder <builder@cyberstorm.dev>
Date: Sat Mar 7 13:10:13 2026 +0700
fix: allow skipping gatus groups
diff --git a/carapace/cli/gatus.py b/carapace/cli/gatus.py
index 6687394..1d31c31 100644
--- a/carapace/cli/gatus.py
+++ b/carapace/cli/gatus.py
@@ -22,15 +22,14 @@ def run_gatus_check(
failed_endpoints = []
total_checked = 0
- skip_groups = set(skip_groups or [])
+ skip_groups_set = {g.lower() for g in (skip_groups or []) if g}
for endpoint in data:
name = endpoint.get("name", "")
group = endpoint.get("group", "")
- results = endpoint.get("results", [])
-
- if group in skip_groups:
+ if skip_groups_set and group.lower() in skip_groups_set:
continue
+ results = endpoint.get("results", [])
# Filter for relevant endpoints. We only care if the endpoint name or group contains our target nodes.
# This prevents failing the build due to dev nodes (like infralink*) being down.
@@ -73,7 +72,12 @@ def run(args: argparse.Namespace) -> int:
try:
# Default nodes to check if none provided
nodes = args.nodes.split(",") if args.nodes else ["cyberstorm-citadel", "cyberstorm-watchtower"]
- skip_groups = args.skip_groups.split(",") if getattr(args, "skip_groups", None) else ["dns"]
+ skip_groups = []
+ if getattr(args, "skip_groups", None):
+ skip_groups = [g.strip() for g in args.skip_groups.split(",") if g.strip()]
+ if not skip_groups:
+ skip_groups = ["dns"]
+
result = run_gatus_check(args.gatus_url, nodes, skip_groups=skip_groups)
payload = envelope(
@@ -95,4 +99,3 @@ def run(args: argparse.Namespace) -> int:
fix="Check Gatus URL and network connectivity"
)
return payload, 1
-