From 4776dc8a66c432a7b72d27b3fbf8c88297ae5f3e Mon Sep 17 00:00:00 2001 From: RocFang Date: Tue, 13 Oct 2020 23:15:42 +0800 Subject: [PATCH] fix: it does'nt make sence to compare etcd_version, since it's nil. (#2390) no need to define a new local cluster_version since it's defined previously. --- bin/apisix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/apisix b/bin/apisix index 6a44095c..895062b6 100755 --- a/bin/apisix +++ b/bin/apisix @@ -984,7 +984,6 @@ local function init_etcd(show_output) yaml_conf.etcd.host = {yaml_conf.etcd.host} end - local cluster_version local host_count = #(yaml_conf.etcd.host) local dkjson = require("dkjson") @@ -1032,7 +1031,7 @@ local function init_etcd(show_output) .. " --max-time " .. timeout * 2 .. " --retry 1 2>&1" local res = execute_cmd(cmd) - if (etcd_version == "v3" and not res:find("OK", 1, true)) then + if res:find("OK", 1, true) then is_success = false if (index == host_count) then error(cmd .. "\n" .. res)