You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "AlinsRan (via GitHub)" <gi...@apache.org> on 2026/07/06 09:09:28 UTC
[PR] fix(resource): support all plugin-bearing resource types in fetch_latest_conf [apisix]
AlinsRan opened a new pull request, #13663:
URL: https://github.com/apache/apisix/pull/13663
### Description
Follow-up to #13458 (and issue #13456).
`resource.fetch_latest_conf` only whitelisted `upstreams`/`routes`/`services`/`stream_routes`. Any resource that attaches plugins via `_meta.parent` (set by `plugin.set_plugins_meta_parent`) but isn't in that list — `plugin_configs`, `global_rules`, `consumers`, `consumer_groups` — hit `unsupported resource type` and returned `nil`.
Concretely, `ai-proxy-multi` with multiple instances referenced through a `plugin_config_id` calls `fetch_latest_conf(conf._meta.parent.resource_key)` in `pick_target`, gets `nil`, and the request fails with `failed to fetch the parent config` (5xx). The same 5xx happens for ai-proxy-multi carried by a global_rule / consumer / consumer_group.
#13458 fixed only `plugin_configs` by adding one more branch. As @nic-6443 pointed out there, every supported prefix just maps to itself, so this replaces the if/else chain with a whitelist lookup table covering all plugin-bearing resource types; each maps to its `/<type>` top-level config key.
### Fixes
Supersedes #13458, closes #13456.
### Test
Added a regression test in `t/plugin/ai-proxy-multi.balancer.t`: an `ai-proxy-multi` plugin_config with two instances, referenced by a route via `plugin_config_id`. Without the fix the request returns 5xx (`failed to fetch the parent config`); with it, it proxies successfully. Verified locally — the whole file passes, and reverting `resource.lua` makes only the new test fail.
--
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
Re: [PR] fix(resource): support all plugin-bearing resource types in fetch_latest_conf [apisix]
Posted by "AlinsRan (via GitHub)" <gi...@apache.org>.
AlinsRan merged PR #13663:
URL: https://github.com/apache/apisix/pull/13663
--
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