Baoyuantop commented on code in PR #12445: URL: https://github.com/apache/apisix/pull/12445#discussion_r2218119593
########## apisix/discovery/nacos/init.lua: ########## @@ -54,6 +55,23 @@ local function get_key(namespace_id, group_name, service_name) return namespace_id .. '.' .. group_name .. '.' .. service_name end + +local function metadata_contains(host_metadata, route_metadata) Review Comment: Could you explain what these two parameters mean? ########## t/discovery/nacos.t: ########## @@ -1066,3 +1066,124 @@ GET /t --- response_body server 1 server 4 + + + +=== TEST 27: get APISIX-NACOS info from NACOS - metadata filtering lane=a (only server1) +--- yaml_config eval: $::yaml_config +--- apisix_yaml +routes: + - + uri: /hello + upstream: + service_name: APISIX-NACOS + discovery_type: nacos + type: roundrobin + discovery_args: + metadata: + lane: "a" +#END +--- pipelined_requests eval +[ + "GET /hello", + "GET /hello", + "GET /hello", + "GET /hello", + "GET /hello", +] +--- response_body_like eval +[ + qr/server 1/, + qr/server 1/, + qr/server 1/, + qr/server 1/, + qr/server 1/, +] + + + +=== TEST 28: get APISIX-NACOS info from NACOS - metadata filtering lane=b (only server2) Review Comment: This case is somewhat repetitive, I think the configuration can be changed to ``` discovery_args: metadata: ``` Test the behavior of metadata being empty. -- 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-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org