From 807dfcea78b0cc7f2d6d3d722db80ea091d44eb8 Mon Sep 17 00:00:00 2001 From: Vimal K Date: Sat, 26 May 2018 04:58:06 +0530 Subject: [PATCH] etcdctl: fixes 9583. trim spaces in ETCDCTL_ENDPOINTS --- etcdctl/ctlv3/command/global.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etcdctl/ctlv3/command/global.go b/etcdctl/ctlv3/command/global.go index 07fdee1af..b6e6048f0 100644 --- a/etcdctl/ctlv3/command/global.go +++ b/etcdctl/ctlv3/command/global.go @@ -394,6 +394,11 @@ func endpointsFromCmd(cmd *cobra.Command) ([]string, error) { // If domain discovery returns no endpoints, check endpoints flag if len(eps) == 0 { eps, err = cmd.Flags().GetStringSlice("endpoints") + if err == nil { + for i, ip := range eps { + eps[i] = strings.TrimSpace(ip) + } + } } return eps, err }