Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(clustering/sync): fix default workspace check #14220

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading