Skip to content

Commit

Permalink
fix(clustering/sync): fix default workspace check
Browse files Browse the repository at this point in the history
  • Loading branch information
Oyami-Srk committed Jan 24, 2025
1 parent 7a505ea commit c1cf5ae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,15 @@ local function do_sync()
-- and replace the old one with it
local default_ws_changed
for _, delta in ipairs(deltas) do
if delta.type == "workspaces" and delta.entity.name == "default" and
kong.default_workspace ~= delta.entity.id
local delta_entity = delta.entity
-- Update default workspace if delta is for workspace update
if delta.type == "workspaces" and
delta_entity ~= nil and
delta_entity ~= ngx_null and
delta_entity.name == "default" and
kong.default_workspace ~= delta_entity.id
then
kong.default_workspace = delta.entity.id
kong.default_workspace = delta_entity.id
default_ws_changed = true
break
end
Expand Down

0 comments on commit c1cf5ae

Please sign in to comment.