nic-6443 opened a new pull request, #13230: URL: https://github.com/apache/apisix/pull/13230
Following the pattern established by #13201 (Nacos + K8s refactor), this PR refactors the Consul discovery module to support a multi-instance registry API while preserving all existing behavior. The goal is to let the Consul module be driven by an external caller (like the EE agent layer) so that multiple Consul registries can coexist, each with their own configuration. **What changed:** - New `client.lua`: HTTP/protocol primitives extracted from `init.lua` — blocking query watchers, service fetching, URL parsing, sort helpers, and service scanner - Refactored `init.lua`: `create_registry()` / `start_registry()` / `stop_registry()` / `get_registry()` / `get_nodes()` multi-instance API, following the same pattern as nacos - Mutable module state moved into per-registry object (skip_service_map, dump_params, consul_services, default_service) - Shared dict keys use registry ID prefix (`default/service_name`) for multi-instance isolation - `all_nodes()` / `dump_data()` / `show_dump_file()` strip the prefix for backward compatibility - Optional metadata filtering via `get_nodes(key, metadata)` - Privileged-agent-only gating preserved for write operations - No schema changes — all existing tests should pass 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
