Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Plural
platform
plural-operator
Commits
8cd0c2e8
Commit
8cd0c2e8
authored
3 years ago
by
michaelguarino
Browse files
Options
Download
Email Patches
Plain Diff
filter runbooks based on alert namespace
parent
2fea7e3a
Pipeline
#798
passed with stage
in 2 minutes and 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
alertmanager/payload.go
+4
-1
alertmanager/payload.go
with
4 additions
and
1 deletion
+4
-1
alertmanager/payload.go
+
4
-
1
View file @
8cd0c2e8
...
...
@@ -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
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment