Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etcd-tester: fix peer-port parsing bug with localhost url #6410

Merged
merged 1 commit into from
Sep 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
etcd-tester: fix peer-port parsing bug with localhost url
The following format "http://localhost:1234" causes existing port parser to fail. Add new logic to parse the host name first then extract port.

Fixes #6409
  • Loading branch information
fanminshi committed Sep 12, 2016
commit 8a63071463b8a93bbd2ca35777e7427d11fbfd30
6 changes: 5 additions & 1 deletion tools/functional-tester/etcd-tester/member.go
Original file line number Diff line number Diff line change
@@ -168,7 +168,11 @@ func (m *member) grpcAddr() string {
}

func (m *member) peerPort() (port int) {
_, portStr, err := net.SplitHostPort(m.PeerURL)
u, err := url.Parse(m.PeerURL)
if err != nil {
panic(err)
}
_, portStr, err := net.SplitHostPort(u.Host)
if err != nil {
panic(err)
}