membphis commented on a change in pull request #1275: Add multiple etcd address 
support.
URL: https://github.com/apache/incubator-apisix/pull/1275#discussion_r393567710
 
 

 ##########
 File path: bin/apisix
 ##########
 @@ -661,28 +661,32 @@ 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
+
+    for _, host in ipairs(yaml_conf.etcd.host) do
 
 Review comment:
   that is the fake code, please take a view.
   
   ```lua
   -- fake code
   for i, host in ipairs(yaml_conf.etcd.host) do
       local is_success = true
       for _, dir_name in ipairs({"/routes", "/upstreams", ...}) do
           local ok = ...
           if not ok then
               is_success = false
               break
           end
       end
   
       if is_success then
           break
       end
   end
   ```

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

Reply via email to