etcdctl/ctlv3: etcd v3.4 makes ETCDCTL_API=3 by default

This commit is contained in:
Vimal K
2018-05-29 02:44:45 +05:30
parent 476c9cbeed
commit 25bc65794f
8 changed files with 50 additions and 18 deletions

View File

@@ -31,13 +31,13 @@ func main() {
apiv := os.Getenv(apiEnv)
// unset apiEnv to avoid side-effect for future env and flag parsing.
os.Unsetenv(apiEnv)
if len(apiv) == 0 || apiv == "2" {
ctlv2.Start(apiv)
if len(apiv) == 0 || apiv == "3" {
ctlv3.Start(apiv)
return
}
if apiv == "3" {
ctlv3.Start()
if apiv == "2" {
ctlv2.Start()
return
}