From 86e37ce378dd95f61182a43bac3cd3668d103903 Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Thu, 14 Nov 2024 10:45:27 +0800 Subject: [PATCH] fix(sync): prevent unnecessary modifications to kong.default_workspace (#13865) https://konghq.atlassian.net/browse/KAG-5814 --- kong/clustering/services/sync/rpc.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kong/clustering/services/sync/rpc.lua b/kong/clustering/services/sync/rpc.lua index a6e4443237b4..1e80906b4649 100644 --- a/kong/clustering/services/sync/rpc.lua +++ b/kong/clustering/services/sync/rpc.lua @@ -212,7 +212,9 @@ 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" then + if delta.type == "workspaces" and delta.entity.name == "default" and + kong.default_workspace ~= delta.entity.id + then kong.default_workspace = delta.entity.id default_ws_changed = true break