diff --git a/lua_configuration/networking.istio.io/VirtualService/trafficRouting.lua b/lua_configuration/networking.istio.io/VirtualService/trafficRouting.lua index 825aa07c..41e48383 100644 --- a/lua_configuration/networking.istio.io/VirtualService/trafficRouting.lua +++ b/lua_configuration/networking.istio.io/VirtualService/trafficRouting.lua @@ -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 \ No newline at end of file