Routing config: Add processName (#5489)

This commit is contained in:
风扇滑翔翼
2026-01-05 09:12:13 +08:00
committed by GitHub
parent e7c72c011f
commit 7265b5ac3f
9 changed files with 614 additions and 77 deletions
+8
View File
@@ -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()
}