Skip to content

Commit

Permalink
fix ChooseInstance
Browse files Browse the repository at this point in the history
Signed-off-by: haozhicui <[email protected]>
  • Loading branch information
haozhicui committed Jan 21, 2025
1 parent 0e1fc4b commit c3b50c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin/loadbalancer/hash/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ func (g *LoadBalancer) ChooseInstance(criteria *loadbalancer.Criteria,
// 按照权重区间来寻找
targetIndex := search.BinarySearch(weightedSlice, uint64(targetValue))
instanceIndex := targetInstances.GetInstances()[targetIndex]
instance := inputInstances.GetInstances()[instanceIndex.Index]

instance := inputInstances.GetServiceClusters().GetServiceInstances().GetInstances()[instanceIndex.Index]

return instance, nil
}

Expand Down

0 comments on commit c3b50c7

Please sign in to comment.