Skip to content

Commit f371bb2

Browse files
fix:动态路由中,支持destination的值'*'匹配 (#181)
1 parent 7fa2070 commit f371bb2

File tree

1 file changed

+4
-0
lines changed
  • plugin/servicerouter/rulebase

1 file changed

+4
-0
lines changed

plugin/servicerouter/rulebase/base.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ func (g *RuleBasedInstancesFilter) matchDstMetadata(routeInfo *servicerouter.Rou
359359
// 首先如果元数据的value无法获取,直接匹配失败
360360
return nil, false, "", nil
361361
}
362+
// 全匹配类型直接返回全量实例
363+
if ruleMetaValueStr == matchAll && ruleMetaValue.ValueType == apimodel.MatchString_TEXT {
364+
return cls, true, "", nil
365+
}
362366
metaValues := svcCache.GetInstanceMetaValues(cls.Location, ruleMetaKey)
363367
if len(metaValues) == 0 {
364368
// 不匹配

0 commit comments

Comments
 (0)