Skip to content

Commit

Permalink
fix: Filter the istio VirtualService retries field
Browse files Browse the repository at this point in the history
Signed-off-by: 赵禹 <[email protected]>
  • Loading branch information
赵禹 committed Dec 11, 2023
1 parent c9d31fe commit b2c8294
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function GetRulesToPatch(spec, stableService, protocol)
local matchedRoutes = {}
if (spec[protocol] ~= nil) then
for _, rule in ipairs(spec[protocol]) do
if next(rule.retries) == nil then
local retries = rule.retries or {}
if #retries == 0 then
rule.retries = nil
end
-- skip routes contain matches
Expand Down Expand Up @@ -49,7 +50,8 @@ end
function GenerateRoutesWithMatches(spec, matches, stableService, canaryService)
local http = spec.http
for _, rule in ipairs(http) do
if next(rule.retries) == nil then
local retries = rule.retries or {}
if #retries == 0 then
rule.retries = nil
end
end
Expand Down

0 comments on commit b2c8294

Please sign in to comment.