SkyeYoung commented on code in PR #12445:
URL: https://github.com/apache/apisix/pull/12445#discussion_r2244489111


##########
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)
+    if not route_metadata or not next(route_metadata) then
+        return true
+    end
+    if not host_metadata or not next(host_metadata) then
+        return false
+    end
+
+    for k, v in pairs(route_metadata) do
+        if host_metadata[k] ~= v then
+            return false
+        end
+    end
+    return true

Review Comment:
   It seems that there is a problem with the logic here:
   
   <img width="755" height="300" alt="Image" 
src="https://github.com/user-attachments/assets/0257ee6e-20b9-4f93-bda3-77d97bac8eb7";
 />
   
   `route_metadata` will not be nil or 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

Reply via email to