Ver Fonte

Merge pull request #9780 from vimalk78/9583_ETCDCTL_ENDPOINT_confused_trim_space

etcdctl/ctlv3 : fixes 9583. trim spaces in ETCDCTL_ENDPOINTS env variable
Xiang Li há 7 anos atrás
pai
commit
ce918cef63
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      etcdctl/ctlv3/command/global.go

+ 5 - 0
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
 }