membphis commented on a change in pull request #1283: Add multiple etcd support.
URL: https://github.com/apache/incubator-apisix/pull/1283#discussion_r394204066
##########
File path: bin/apisix
##########
@@ -706,28 +706,43 @@ local function init_etcd(show_output)
end
local etcd_conf = yaml_conf.etcd
- local uri = etcd_conf.host .. "/v2/keys" .. (etcd_conf.prefix or "")
local timeout = etcd_conf.timeout or 3
+ local uri
+ local host_count = #(yaml_conf.etcd.host)
Review comment:
Apache APISIX users may use the old `conf/config.yaml` and I think we should
check the data type first.
For example Lua code:
```lua
if type(yaml_conf.etcd.host) == "string" then
yaml_conf.etcd.host = {yaml_conf.etcd.host}
end
local host_count = #(yaml_conf.etcd.host)
...
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services