-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Auto-join support for IPv6 discovery #12366
Conversation
The go-discover library returns IP addresses and not URLs. It just so happens net.URL parses "127.0.0.1", which isn't a valid URL. Instead, we construct the URL ourselves. Being careful to check if it's an ipv6 address and making sure it's in explicit form if so. Fixes hashicorp#12323
e9de18a
to
8351e5c
Compare
The PR looks pretty great! One thing, could you maybe try to add a test similar to this https://github.com/hashicorp/vault/blob/main/vault/external_tests/raft/raft_test.go#L129, that does the same but for ipv6 addresses ? It's probably gonna be fairly tricky, I can't exactly tell how much, but a test to show this change works would be nice i think. |
I would be happy to try. I wanted to add a test when I wrote the PR up, but I couldn't figure out how to do that. I didn't see this area of the codebase though, so I'll give it a whirl! |
sounds great, and thanks! |
The test Sadly we don't currently have a good way of running our automated CI tests with access to AWS, so it may well be that there's no good way to test this change other than manually. |
aha gotcha, thanks for the clarification @ncabatoff ! In that case, please feel free to ignore the request for a test addition @dekimsey , once I've validated the fix works on my end, will merge this in. |
Rename addrs to clusterIPs to improve clarity and intent Tighten up our IPv6 address detection to be more correct and to ensure it's actually in implicit form
The go-discover library returns IP addresses and not URLs. It just so
happens net.URL parses "127.0.0.1", which isn't a valid URL.
Instead, we construct the URL ourselves. Being careful to check if it's
an ipv6 address and making sure it's in explicit form if so.
Fixes #12323