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

fix host port handling for ipv6, fixes #16550 #16723

Merged
merged 4 commits into from
Apr 21, 2023
Merged

Conversation

valodzka
Copy link
Contributor

@valodzka valodzka commented Mar 30, 2023

Closes #16550

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 30, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@lgfa29 lgfa29 left a 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 🙂

@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
addr := net.JoinHostPort("%s:%d", member.Addr, member.Port)
addr := net.JoinHostPort(member.Addr, member.Port)

@valodzka
Copy link
Contributor Author

Do you think you would be able to add some tests?

@lgfa29 I'm not very familiar with go but here is my try :)

Copy link
Contributor

@lgfa29 lgfa29 left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.3.x backport to 1.3.x release line backport/1.4.x backport to 1.4.x release line backport/1.5.x backport to 1.5.x release line
Projects
Development

Successfully merging this pull request may close these issues.

NOMAD_ADDR_* variables incorrect with ipv6
3 participants