-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix host port handling for ipv6, fixes #16550 #16723
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @valodzka!
Do you think you would be able to add some tests? I think something like TestEnvironment_AsList
but using IPv6 addresses would do the trick.
Feel free to reach out if you need any help 🙂
command/agent/agent_endpoint_test.go
Outdated
@@ -155,7 +155,7 @@ func TestHTTP_AgentJoin(t *testing.T) { | |||
httpTest(t, nil, func(s *TestAgent) { | |||
// Determine the join address | |||
member := s.Agent.Server().LocalMember() | |||
addr := fmt.Sprintf("%s:%d", member.Addr, member.Port) | |||
addr := net.JoinHostPort("%s:%d", member.Addr, member.Port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addr := net.JoinHostPort("%s:%d", member.Addr, member.Port) | |
addr := net.JoinHostPort(member.Addr, member.Port) |
@lgfa29 I'm not very familiar with go but here is my try :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional tests @valodzka, you're practically a Go pro at this point 😄
I pushed a couple of commits to add a changelog entry and also to fix a tiny problem in one of the test.
Closes #16550