Routing config: Add processName (#5489)
This commit is contained in:
1 parent
e7c72c011f
commit
7265b5ac3f
9 files changed
+614
-77
No files matched your search
@@ -106,6 +106,14 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
|
||||
conds.Add(matcher)
|
||||
}
|
||||
|
||||
if len(rr.ProcessName) > 0 {
|
||||
refinedNames := make([]string, 0, len(rr.ProcessName))
|
||||
for _, name := range rr.ProcessName {
|
||||
refinedNames = append(refinedNames, strings.TrimSuffix(name, ".exe"))
|
||||
}
|
||||
conds.Add(&ProcessNameMatcher{refinedNames})
|
||||
}
|
||||
|
||||
if conds.Len() == 0 {
|
||||
return nil, errors.New("this rule has no effective fields").AtWarning()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user