make GroupConditionPatterns uniform with the accepted PR

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-07-02 10:57:29 +02:00
parent f78e4b0443
commit 5e5a09f164
4 changed files with 90 additions and 19 deletions

View File

@@ -1169,13 +1169,24 @@ func checkEventGroupConditionPatterns(groups []sdk.GroupMapping, patterns []data
if len(patterns) == 0 {
return true
}
matches := false
for _, group := range groups {
if checkEventConditionPatterns(group.Name, patterns) {
return true
for _, p := range patterns {
// assume, that multiple InverseMatches are set
if p.InverseMatch {
if checkEventConditionPattern(p, group.Name) {
matches = true
} else {
return false
}
} else {
if checkEventConditionPattern(p, group.Name) {
return true
}
}
}
}
return false
return matches
}
func getHTTPRuleActionEndpoint(c *dataprovider.EventActionHTTPConfig, replacer *strings.Replacer) (string, error) {