Skip to content

Commit

Permalink
move to default
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 7, 2024
1 parent c4e561f commit 6185a02
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function _M:init_cp(manager)
-- CP
-- Method: kong.sync.v2.get_delta
-- Params: versions: list of current versions of the database
-- example: { default = { version = 1000, }, }
-- example: { default = { version = 1000, node = "3.9.0"}, }
manager.callbacks:register("kong.sync.v2.get_delta", function(node_id, current_versions)
ngx_log(ngx_DEBUG, "[kong.sync.v2] config push (connected client)")

Expand All @@ -72,7 +72,7 @@ function _M:init_cp(manager)
last_seen = ngx.time(),
hostname = node_id,
ip = kong.rpc:get_peer_ip(node_id), -- try to get the correct ip
version = current_versions.node_version, -- get from rpc call
version = default_namespace.node, -- get from rpc call
sync_status = CLUSTERING_SYNC_STATUS.NORMAL,
config_hash = fmt("%032d", default_namespace_version),
rpc_capabilities = rpc_peers and rpc_peers[node_id] or {},
Expand Down Expand Up @@ -187,9 +187,8 @@ local function do_sync()
{ default =
{ version =
tonumber(declarative.get_current_hash()) or 0,
node = kong.version, -- cp need this info
},
-- cp need this info
node_version = kong.version,
})
if not ns_deltas then
ngx_log(ngx_ERR, "sync get_delta error: ", err)
Expand Down

0 comments on commit 6185a02

Please sign in to comment.