shreemaan-abhishek commented on code in PR #10950:
URL: https://github.com/apache/apisix/pull/10950#discussion_r1588726319
##########
ci/pod/docker-compose.first.yml:
##########
@@ -109,6 +109,7 @@ services:
- consul.cluster
## Nacos cluster
+
Review Comment:
this change is not needed
##########
apisix/discovery/nacos/init.lua:
##########
@@ -405,12 +434,17 @@ function _M.init_worker()
return
end
- default_weight = local_conf.discovery.nacos.weight
- log.info('default_weight:', default_weight)
+ --default_weight = local_conf.discovery.nacos.weight
+ --log.info('default_weight:', default_weight)
+ if local_conf.discovery.nacos.host
+ then
+ log.warn("config \"naocs.host\" will be deprecated soon.")
+ end
+
local fetch_interval = local_conf.discovery.nacos.fetch_interval
log.info('fetch_interval:', fetch_interval)
- access_key = local_conf.discovery.nacos.access_key
- secret_key = local_conf.discovery.nacos.secret_key
+ --access_key = local_conf.discovery.nacos.access_key
Review Comment:
ditto
##########
apisix/discovery/nacos/init.lua:
##########
@@ -405,12 +434,17 @@ function _M.init_worker()
return
end
- default_weight = local_conf.discovery.nacos.weight
- log.info('default_weight:', default_weight)
+ --default_weight = local_conf.discovery.nacos.weight
Review Comment:
why change these?
##########
apisix/discovery/nacos/init.lua:
##########
@@ -225,6 +224,12 @@ 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)
Review Comment:
```suggestion
local nacos_name_from_args = (up.discovery_args and
up.discovery_args.name)
```
Do you think this is better?
##########
apisix/discovery/nacos/init.lua:
##########
@@ -308,10 +314,11 @@ local function fetch_full_registry(premature)
local scheme = service_info.scheme or ''
local namespace_param = get_namespace_param(service_info.namespace_id)
local group_name_param = get_group_name_param(service_info.group_name)
- local signature_param = get_signed_param(service_info.group_name,
service_info.service_name)
+ local signature_param = get_signed_param(service_info.group_name,
+ service_info.service_name, nacos)
local query_path = instance_list_path .. service_info.service_name
- .. token_param .. namespace_param ..
group_name_param
- .. signature_param
+ .. token_param .. namespace_param .. group_name_param
Review Comment:
there are many other whitespace changes like this, please revert them
##########
docs/en/latest/discovery/nacos.md:
##########
@@ -34,26 +34,45 @@ Add following configuration in `conf/config.yaml` :
```yaml
discovery:
nacos:
- host:
+ name: "default" # Deprecated,see nacos.hosts.name
+ host: # Deprecated,see nacos.hosts.host
- "http://${username}:${password}@${host1}:${port1}"
- prefix: "/nacos/v1/"
- fetch_interval: 30 # default 30 sec
- # `weight` is the `default_weight` that will be attached to each
discovered node that
- # doesn't have a weight explicitly provided in nacos results
- weight: 100 # default 100
- timeout:
- connect: 2000 # default 2000 ms
- send: 2000 # default 2000 ms
- read: 5000 # default 5000 ms
+ prefix: "/nacos/v1/" # Deprecated,see nacos.hosts.prefix.
+ fetch_interval: 30 # default 30 sec.all nacos in config will use this
config
+
+ weight: 100 # Deprecated see nacos.hosts.weight
+ timeout: # Deprecated see nacos.hosts.timeout
+ connect: 2000 # Deprecated see nacos.hosts.timeout
+ send: 2000 # Deprecated see nacos.hosts.timeout
+ read: 5000 # Deprecated see nacos.hosts.timeout
+ access_key: "" # Deprecated see nacos.hosts.access_key
+ secret_key: "" # Deprecated see nacos.hosts.secret_key
+ hosts:
+ - name: "your_nacos_cluster_name" #your nacos cluster name
+ host:
+ - "http://${username}:${password}@${host1}:${port1}"
+ prefix: "/nacos/v1/"
+ # `weight` is the `default_weight` that will be attached to each
discovered node that
+ # doesn't have a weight explicitly provided in nacos results
+ weight: 100 # default 100
+ timeout:
+ connect: 2000 # default 2000 ms
+ send: 2000 # default 2000 ms
+ read: 5000 # default 5000 ms
+ access_key: "" # Nacos AccessKey ID in Alibaba Cloud, notice
that it's for Nacos instances on
+ # Microservices Engine (MSE)
+ secret_key: "" # Nacos AccessKey Secret in Alibaba Cloud,
notice that it's for Nacos instances on
+ # Microservices Engine (MSE)
```
And you can config it in short by default value:
```yaml
discovery:
nacos:
- host:
- - "http://192.168.33.1:8848"
+ hosts:
+ - host:
Review Comment:
this doesn't seem the right way. I think the following is better:
```yaml
nacos:
hosts:
- xyz
- abc
```
--
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]