diff --git a/apisix/plugin.lua b/apisix/plugin.lua index a01bdfd1855d..789eb528d546 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 2ee975d0d990..fd3c35734d88 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