fixbug: Delete match with traffic judgment

Signed-off-by: 赵禹 <12424564+craincn@user.noreply.gitee.com>
This commit is contained in:
赵禹 2024-01-03 17:41:19 +08:00
parent 30dbda7d22
commit e5efd3c9e1
1 changed files with 5 additions and 7 deletions

View File

@ -23,12 +23,10 @@ function GetRulesToPatch(spec, stableService, protocol)
if #retries == 0 then
rule.retries = nil
end
-- skip routes contain matches
if (rule.match == nil) then
for _, route in ipairs(rule.route) do
if GetHost(route) == stableService then
table.insert(matchedRoutes, rule)
end
for _, route in ipairs(rule.route) do
if GetHost(route) == stableService then
table.insert(matchedRoutes, rule)
end
end
end
@ -134,4 +132,4 @@ else
GenerateRoutes(spec, obj.stableService, obj.canaryService, obj.stableWeight, obj.canaryWeight, "tcp")
GenerateRoutes(spec, obj.stableService, obj.canaryService, obj.stableWeight, obj.canaryWeight, "tls")
end
return obj.data
return obj.data