Merge pull request #9780 from vimalk78/9583_ETCDCTL_ENDPOINT_confused_trim_space

etcdctl/ctlv3 : fixes 9583. trim spaces in ETCDCTL_ENDPOINTS env variable
release-3.4
Xiang Li 2018-05-27 09:38:38 -07:00 committed by GitHub
commit ce918cef63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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
}