if 'include capi' is false, only exclude capi alerts instead of assuming they necessarily have attached decisions (#2435)
This commit is contained in:
parent
6b9e065764
commit
0040569fa9
1 changed files with 1 additions and 5 deletions
|
@ -862,11 +862,7 @@ func AlertPredicatesFromFilter(filter map[string][]string) ([]predicate.Alert, e
|
|||
predicates = append(predicates, alert.HasDecisionsWith(decision.OriginEQ(value[0])))
|
||||
case "include_capi": //allows to exclude one or more specific origins
|
||||
if value[0] == "false" {
|
||||
predicates = append(predicates, alert.HasDecisionsWith(
|
||||
decision.Or(decision.OriginEQ(types.CrowdSecOrigin),
|
||||
decision.OriginEQ(types.CscliOrigin),
|
||||
decision.OriginEQ(types.ConsoleOrigin),
|
||||
decision.OriginEQ(types.CscliImportOrigin))))
|
||||
predicates = append(predicates, alert.Not(alert.HasDecisionsWith(decision.OriginEQ(types.CAPIOrigin))))
|
||||
} else if value[0] != "true" {
|
||||
log.Errorf("Invalid bool '%s' for include_capi", value[0])
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue