From 33f043e91a27fc66ac5537aa66498ce8552c6a21 Mon Sep 17 00:00:00 2001 From: Robin Xiang Date: Wed, 18 Sep 2024 13:56:25 +0800 Subject: [PATCH] fix(core): `node_id` in configuration is deprecated in this PR, which means it is not recommended to be specified manually. A warning message is printed in the error log if the `node_id` is recognized in the configuration. FTI-6221 --- changelog/unreleased/kong/deprecate_node_id.yml | 3 +++ kong/pdk/node.lua | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 changelog/unreleased/kong/deprecate_node_id.yml diff --git a/changelog/unreleased/kong/deprecate_node_id.yml b/changelog/unreleased/kong/deprecate_node_id.yml new file mode 100644 index 000000000000..60a2eddb083f --- /dev/null +++ b/changelog/unreleased/kong/deprecate_node_id.yml @@ -0,0 +1,3 @@ +message: "`node_id` in configuration has been deprecated." +scope: Core +type: deprecation diff --git a/kong/pdk/node.lua b/kong/pdk/node.lua index 9302c17cde1a..269e9c75112a 100644 --- a/kong/pdk/node.lua +++ b/kong/pdk/node.lua @@ -272,6 +272,9 @@ local function new(self) -- 1. user provided node id local configuration_node_id = self and self.configuration and self.configuration.node_id if configuration_node_id then + ngx.log(ngx.WARN, "The `node_id`, which has been deprecated since 3.9, is not recommended to be specified manually!!!\n", + "Please make sure it is unique across the cluster.\n", + "Please note that it will be removed from configuration since 4.x.") node_id = configuration_node_id end -- 2. node id (if any) on file-system