Skip to content

Commit

Permalink
Merge pull request etcd-io#9780 from vimalk78/9583_ETCDCTL_ENDPOINT_c…
Browse files Browse the repository at this point in the history
…onfused_trim_space

etcdctl/ctlv3 : fixes 9583. trim spaces in ETCDCTL_ENDPOINTS env variable
  • Loading branch information
xiang90 authored May 27, 2018
2 parents 357308b + 807dfce commit ce918ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions etcdctl/ctlv3/command/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ce918ce

Please sign in to comment.