mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-16 18:47:10 +00:00
Make inhibitor consider equality labels
This commit is contained in:
parent
8c15e18571
commit
331911edee
12
inhibit.go
12
inhibit.go
@ -110,5 +110,15 @@ func NewInhibitRule(cr *config.InhibitRule) *InhibitRule {
|
||||
}
|
||||
|
||||
func (r *InhibitRule) Mutes(source, target model.LabelSet) bool {
|
||||
return r.TargetMatchers.Match(target) && r.SourceMatchers.Match(source)
|
||||
if r.TargetMatchers.Match(target) && r.SourceMatchers.Match(source) {
|
||||
for ln := range r.Equal {
|
||||
if source[ln] != target[ln] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user