From 07030d59dd5ad0309d2e7b9a198750dd810e86db Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Sat, 5 Mar 2016 12:27:46 -0800 Subject: [PATCH] e2e: use endpoints flag --- e2e/etcdctl_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/e2e/etcdctl_test.go b/e2e/etcdctl_test.go index b23a7aa32..466370b31 100644 --- a/e2e/etcdctl_test.go +++ b/e2e/etcdctl_test.go @@ -15,6 +15,7 @@ package e2e import ( + "strings" "testing" "time" @@ -214,13 +215,17 @@ func testCtlV2GetRoleUser(t *testing.T, cfg *etcdProcessClusterConfig) { } func etcdctlPrefixArgs(clus *etcdProcessCluster, noSync bool) []string { - endpoint := "" + endpoints := "" if proxies := clus.proxies(); len(proxies) != 0 { - endpoint = proxies[0].cfg.acurl.String() + endpoints = proxies[0].cfg.acurl.String() } else if backends := clus.backends(); len(backends) != 0 { - endpoint = backends[0].cfg.acurl.String() + es := []string{} + for _, b := range backends { + es = append(es, b.cfg.acurl.String()) + } + endpoints = strings.Join(es, ",") } - cmdArgs := []string{"../bin/etcdctl", "--endpoint", endpoint} + cmdArgs := []string{"../bin/etcdctl", "--endpoints", endpoints} if noSync { cmdArgs = append(cmdArgs, "--no-sync") }