starsz commented on a change in pull request #2965:
URL: https://github.com/apache/apisix/pull/2965#discussion_r537210247
##########
File path: apisix/cli/etcd.lua
##########
@@ -132,22 +134,23 @@ function _M.init(env, show_output)
-- check the etcd cluster version
for index, host in ipairs(yaml_conf.etcd.host) do
- uri = host .. "/version"
- local cmd = str_format("curl -s -m %d %s", timeout * 2, uri)
- local res = util.execute_cmd(cmd)
- local errmsg = str_format("got malformed version message: \"%s\" from
etcd\n",
- res)
+ local version_url = host .. "/version"
+ local errmsg
- local body, _, err = dkjson.decode(res)
- if err then
+ local res, err = http.request(version_url)
Review comment:
Right. The library doesn't support max-timeout.
----------------------------------------------------------------
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]