shreemaan-abhishek commented on code in PR #10950:
URL: https://github.com/apache/apisix/pull/10950#discussion_r1574169719


##########
apisix/discovery/nacos/init.lua:
##########
@@ -225,13 +224,20 @@ local function iter_and_add_service(services, values)
         else
             up = conf
         end
+        local nacos_name_form_args = (up.discovery_args and 
up.discovery_args.name)
+             or default_nacos_name
+        local nacos_name = nacos.name or default_nacos_name
+        if   nacos_name ~= nacos_name_form_args then

Review Comment:
   a lot of code style problems are there, please pay attention and fix 
elsewhere
   ```suggestion
           if nacos_name ~= nacos_name_form_args then
   ```



##########
apisix/discovery/nacos/init.lua:
##########
@@ -33,14 +33,12 @@ local str_byte           = string.byte
 local str_find           = core.string.find
 local log                = core.log
 
-local default_weight
-local applications
+local applications ={}
 local auth_path = 'auth/login'
 local instance_list_path = 'ns/instance/list?healthyOnly=true&serviceName='
 local default_namespace_id = "public"
 local default_group_name = "DEFAULT_GROUP"
-local access_key
-local secret_key
+local default_nacos_name ="default"

Review Comment:
   ```suggestion
   local default_nacos_name = "default"
   ```



##########
apisix/discovery/nacos/init.lua:
##########
@@ -33,14 +33,12 @@ local str_byte           = string.byte
 local str_find           = core.string.find
 local log                = core.log
 
-local default_weight
-local applications
+local applications ={}

Review Comment:
   ```suggestion
   local applications = {}
   ```



##########
apisix/discovery/nacos/init.lua:
##########
@@ -185,8 +183,9 @@ local function get_base_uri()
         url = protocol .. other
     end
 
-    if local_conf.discovery.nacos.prefix then
-        url = url .. local_conf.discovery.nacos.prefix
+    local prefix =nacos.prefix

Review Comment:
   ```suggestion
       local prefix = nacos.prefix
   ```



##########
apisix/discovery/nacos/init.lua:
##########
@@ -225,13 +224,20 @@ local function iter_and_add_service(services, values)
         else
             up = conf
         end
+        local nacos_name_form_args = (up.discovery_args and 
up.discovery_args.name)
+             or default_nacos_name
+        local nacos_name = nacos.name or default_nacos_name
+        if   nacos_name ~= nacos_name_form_args then
+             goto CONTINUE
+        end
 
         local namespace_id = (up.discovery_args and 
up.discovery_args.namespace_id)
                              or default_namespace_id
 
         local group_name = (up.discovery_args and up.discovery_args.group_name)
                            or default_group_name
 
+

Review Comment:
   not needed



-- 
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]

Reply via email to