Skip to content

Commit 6b6ed7e

Browse files
author
wuhua3
committed
code review
1 parent 6810940 commit 6b6ed7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cluster/clusterSelector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func (d *DefaultClusterSelector) Init(clusterGroup motan.ClusterGroup) {
2222
}
2323

2424
func (d *DefaultClusterSelector) Select(request motan.Request) motan.Cluster {
25-
routeGroup := strings.TrimSpace(request.GetAttachment(MRouteGroup))
25+
routeGroup := request.GetAttachment(MRouteGroup)
2626
if routeGroup != "" {
2727
var sandboxGroup string
2828
var greyGroup string
@@ -32,7 +32,7 @@ func (d *DefaultClusterSelector) Select(request motan.Request) motan.Cluster {
3232
if d.defaultGreyCluster != nil && len(d.defaultGreyCluster.GetRefers()) > 0 {
3333
greyGroup = d.defaultGreyCluster.GetURL().Group
3434
}
35-
if sandboxGroup != "" && routeGroup == DefaultSandboxRouteGroup {
35+
if sandboxGroup != "" && strings.TrimSpace(routeGroup) == DefaultSandboxRouteGroup {
3636
return d.defaultSandboxCluster
3737
}
3838
routeGroupList := motan.TrimSplit(routeGroup, ",")

0 commit comments

Comments
 (0)