This is an automated email from the ASF dual-hosted git repository.
ashishtiwari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 54eff2817 fix: add warning log when skipping check for disabled plugin
(#12655)
54eff2817 is described below
commit 54eff28177de21bad24723a20d5c548db7e2a414
Author: Ashish Tiwari <[email protected]>
AuthorDate: Thu Oct 9 14:33:51 2025 +0530
fix: add warning log when skipping check for disabled plugin (#12655)
---
apisix/plugin.lua | 2 ++
t/config-center-yaml/plugin.t | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/apisix/plugin.lua b/apisix/plugin.lua
index a01bdfd18..789eb528d 100644
--- a/apisix/plugin.lua
+++ b/apisix/plugin.lua
@@ -893,6 +893,8 @@ local function check_single_plugin_schema(name,
plugin_conf, schema_type, skip_d
local plugin_obj = local_plugins_hash[name]
if not plugin_obj then
if skip_disabled_plugin then
+ core.log.warn("skipping check schema for disabled or unknown
plugin [",
+ name, "]. Enable the plugin or modify
configuration")
return true
else
return false, "unknown plugin [" .. name .. "]"
diff --git a/t/config-center-yaml/plugin.t b/t/config-center-yaml/plugin.t
index 2ee975d0d..fd3c35734 100644
--- a/t/config-center-yaml/plugin.t
+++ b/t/config-center-yaml/plugin.t
@@ -40,6 +40,10 @@ _EOC_
my $routes = <<_EOC_;
routes:
- uri: /hello
+ plugins:
+ ip-restriction:
+ whitelist:
+ - "127.0.0.1"
upstream:
nodes:
"127.0.0.1:1980": 1
@@ -227,3 +231,38 @@ hello world
use config_provider: yaml
load(): new plugins: {}
load_stream(): new plugins: {}
+
+
+
+=== TEST 7: route with plugin not in plugins list
+--- yaml_config
+apisix:
+ node_listen: 1984
+ enable_admin: false
+deployment:
+ role: data_plane
+ role_data_plane:
+ config_provider: yaml
+plugins:
+--- debug_config eval: $::debug_config
+--- config
+ location /t {
+ content_by_lua_block {
+ ngx.sleep(0.3)
+ local http = require "resty.http"
+ local httpc = http.new()
+ local uri = "http://127.0.0.1:" .. ngx.var.server_port .. "/hello"
+ local res, err = httpc:request_uri(uri, {
+ method = "GET",
+ })
+ ngx.print(res.body)
+ }
+ }
+--- request
+GET /t
+--- response_body
+hello world
+--- no_error_log
+[error]
+--- error_log
+skipping check schema for disabled or unknown plugin [ip-restriction]. Enable
the plugin or modify configuration