spacewander commented on a change in pull request #2690:
URL: https://github.com/apache/apisix/pull/2690#discussion_r526901780



##########
File path: bin/apisix
##########
@@ -560,6 +560,26 @@ local function init_etcd(show_output)
     for index, host in ipairs(yaml_conf.etcd.host) do
         local is_success = true
 
+        local token_head = ""
+        if etcd_conf.user and etcd_conf.password then
+            local uri_auth = host .. "/v3/auth/authenticate"
+            local json_auth = {
+                name =  etcd_conf.user,
+                password = etcd_conf.password
+            }
+            local post_json_auth = dkjson.encode(json_auth)
+            local cmd_auth = "curl -s " .. uri_auth .. " -X POST -d '" .. 
post_json_auth
+                             .. "' --connect-timeout " .. timeout
+                             .. " --max-time " .. timeout * 2 .. " --retry 1 
2>&1"
+
+            local res_auth = execute_cmd(cmd_auth)

Review comment:
       @jxhecong
   The check failed because `execute_cmd` doesn't exist (it should be 
`util.execute_cmd`). Let's fix it and see what's next.




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


Reply via email to