You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "nic-6443 (via GitHub)" <gi...@apache.org> on 2026/06/11 03:30:17 UTC

Re: [PR] fix(resource): add plugin_configs support for fetch_latest_conf, fix ai-proxy-multi plugin with multi instance not support plugin_config_id [apisix]

nic-6443 commented on code in PR #13458:
URL: https://github.com/apache/apisix/pull/13458#discussion_r3393070033


##########
apisix/resource.lua:
##########
@@ -59,6 +59,8 @@ local function fetch_latest_conf(resource_path)
         key = "/services"
     elseif resource_type == "stream_routes" then
         key = "/stream_routes"
+    elseif resource_type == "plugin_configs" then

Review Comment:
   This fixes `plugin_configs`, but the same 503 still exists for the other resource types that attach plugins with `_meta.parent`: `apisix/global_rules.lua`, `apisix/consumer_group.lua` and `apisix/consumer.lua` all call `plugin.set_plugins_meta_parent` too, so e.g. ai-proxy-multi with multiple instances in a global_rule fails with the exact same `unsupported resource type` error. Since every supported prefix here just maps to itself, maybe turn this if/else chain into a lookup table covering all resource types that can carry plugins, instead of adding them one at a time.



##########
apisix/resource.lua:
##########
@@ -59,6 +59,8 @@ local function fetch_latest_conf(resource_path)
         key = "/services"
     elseif resource_type == "stream_routes" then
         key = "/stream_routes"
+    elseif resource_type == "plugin_configs" then
+        key = "/plugin_configs"

Review Comment:
   To make Baoyuantop's ask concrete: none of the `t/plugin/ai-proxy-multi*.t` files currently exercise `plugin_config_id`, so this bug had no coverage. A minimal regression block would fit in `t/plugin/ai-proxy-multi.balancer.t`: create a plugin_config with ai-proxy-multi and 2 instances, create a route referencing it via `plugin_config_id`, then assert the request succeeds — before this fix it returns 503 with `failed to fetch the parent config`. The existing multi-instance setup in that file can be reused almost as-is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org