Commit 8cd0c2e8 authored by michaelguarino's avatar michaelguarino
Browse files

filter runbooks based on alert namespace

parent 2fea7e3a
Pipeline #798 passed with stage
in 2 minutes and 46 seconds
Showing with 4 additions and 1 deletion
+4 -1
......@@ -27,7 +27,10 @@ const (
func matchesRunbook(alert *Alert, runbook *platformv1alpha1.Runbook) bool {
for _, val := range runbook.Spec.Alerts {
if name, ok := alert.Labels[nameLabel]; ok && name == val.Name {
name, ok := alert.Labels[nameLabel]
namespace, nsOk := alert.Labels["namespace"]
if ok && name == val.Name && (!nsOk || namespace == runbook.Namespace) {
return true
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment