add canary-weight-total annotation (#6338)
This commit is contained in:
parent
6163231ef6
commit
5cff197bc5
7 changed files with 71 additions and 5 deletions
|
|
@ -259,7 +259,11 @@ local function route_to_alternative_balancer(balancer)
|
|||
end
|
||||
end
|
||||
|
||||
if math.random(100) <= traffic_shaping_policy.weight then
|
||||
local weightTotal = 100
|
||||
if traffic_shaping_policy.weightTotal ~= nil and traffic_shaping_policy.weightTotal > 100 then
|
||||
weightTotal = traffic_shaping_policy.weightTotal
|
||||
end
|
||||
if math.random(weightTotal) <= traffic_shaping_policy.weight then
|
||||
return true
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue