You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/06/07 14:06:31 UTC

[GitHub] [incubator-apisix] dabue opened a new pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

dabue opened a new pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665


   ### Summary
   
   check whether  the user has enabled etcd v2 protocol.
   
   ### Full changelog
   
   update the apisix_cli_test.sh to provide a friendly error message when  etvd v2 not enabled.
   ### Issues resolved
   
   Fix #1523 
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] membphis commented on a change in pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665#discussion_r437071799



##########
File path: bin/apisix
##########
@@ -781,6 +781,16 @@ local function init_etcd(show_output)
 
     local host_count = #(yaml_conf.etcd.host)
 
+    -- check whether the user has enabled etcd v2 protocol
+    for index, host in ipairs(yaml_conf.etcd.host) do
+        uri = host .. "/v2/keys"
+        local cmd = "curl -i -m ".. timeout * 2 .. " -o /dev/null -s -w %{http_code} " .. uri
+        local res = excute_cmd(cmd)
+        if res == "404" then
+            error("failed: Please make sure that you have enabled the v2 protocol of etcd on " .. host)

Review comment:
       this way is not friendly.
   
   `io.stderr:write(string.format("%d is negative\n",x))`




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] membphis merged pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
membphis merged pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] dabue edited a comment on pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
dabue edited a comment on pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665#issuecomment-640322281


   > @dabue I think you need to add this check in `bin/apisix` intead of travis CI.
   
   You are right. It's more reasonable to put it there,I will update it.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] moonming commented on pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665#issuecomment-640319453


   @dabue I think you need to add this check in `bin/apisix` intead of travis CI.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] dabue commented on a change in pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
dabue commented on a change in pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665#discussion_r437089401



##########
File path: bin/apisix
##########
@@ -781,6 +781,16 @@ local function init_etcd(show_output)
 
     local host_count = #(yaml_conf.etcd.host)
 
+    -- check whether the user has enabled etcd v2 protocol
+    for index, host in ipairs(yaml_conf.etcd.host) do
+        uri = host .. "/v2/keys"
+        local cmd = "curl -i -m ".. timeout * 2 .. " -o /dev/null -s -w %{http_code} " .. uri
+        local res = excute_cmd(cmd)
+        if res == "404" then
+            error("failed: Please make sure that you have enabled the v2 protocol of etcd on " .. host)

Review comment:
       I have updated it , please review.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] dabue commented on a change in pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
dabue commented on a change in pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665#discussion_r436441118



##########
File path: bin/apisix
##########
@@ -781,6 +781,17 @@ local function init_etcd(show_output)
 
     local host_count = #(yaml_conf.etcd.host)
 
+    -- check whether the user has enabled etcd v2 protocol
+    for index, host in ipairs(yaml_conf.etcd.host) do
+        uri = host .. "/v2/keys"
+        local cmd = "curl -i -m ".. timeout * 2 .. " -o /dev/null -s -w %{http_code} " .. uri
+        local res = excute_cmd(cmd)
+        if res == "404" then
+            print("failed: Please make sure that you have enabled the v2 protocol of etcd on " .. host)

Review comment:
       have updated it.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] dabue commented on pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
dabue commented on pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665#issuecomment-640322281


   > @dabue I think you need to add this check in `bin/apisix` intead of travis CI.
   
   You are right. It's more reasonable to put it there,I will update.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] membphis commented on a change in pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665#discussion_r436440039



##########
File path: bin/apisix
##########
@@ -781,6 +781,17 @@ local function init_etcd(show_output)
 
     local host_count = #(yaml_conf.etcd.host)
 
+    -- check whether the user has enabled etcd v2 protocol
+    for index, host in ipairs(yaml_conf.etcd.host) do
+        uri = host .. "/v2/keys"
+        local cmd = "curl -i -m ".. timeout * 2 .. " -o /dev/null -s -w %{http_code} " .. uri
+        local res = excute_cmd(cmd)
+        if res == "404" then
+            print("failed: Please make sure that you have enabled the v2 protocol of etcd on " .. host)

Review comment:
       we should use std_err to print the error message




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] dabue commented on pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
dabue commented on pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665#issuecomment-640340120


   I have updated it, please review, thx.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-apisix] membphis commented on pull request #1665: [bugfix(CLI)]: check whether the user has enabled etcd v2 protocol.

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #1665:
URL: https://github.com/apache/incubator-apisix/pull/1665#issuecomment-641266164


   @dabue merged right now, many thx.


----------------------------------------------------------------
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:
users@infra.apache.org