-
Notifications
You must be signed in to change notification settings - Fork 148
fix: pass IPv6 DNS resolvers correctly #4358
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
Conversation
|
Hi @lucasl0st! Thanks for opening this pull request! |
|
@lucasl0st Thanks for finding and fixing this! Would you mind creating an associated issue and linking it in the PR description to |
de42f92 to
75bafa6
Compare
|
Based on what I read in the bug you created, does the NGF validation need to be updated as well? |
Could you tell me what exactly you mean by NGF validation?
It does not accept IPv6 addresses within [] brackets, but I'm unsure if that's what you're referring to here |
|
And just to be sure, anything I should do regarding the failed linter in the pipeline? https://github.com/nginx/nginx-gateway-fabric/actions/runs/19806475453/job/56824105560 Runs fine locally for me |
Is the intention to be able to define an Ipv6 address with brackets in the API? If port is specified, then would it make sense to do it that way? I figured we would want to loosen the validation if so. |
|
My intention with this PR is to support IPv6 resolvers the same way IPv4 resolvers are currently supported. The current implementation/validation would not allow for custom ports (to the best of my knowledge), for IPv6 as well as IPv4. |
|
Ah, I see that ports was not the original intention. So I think the validation is fine for now as long as a basic IPv6 address works. |
|
I think the linting/dependency issue is probably on our end. |
059b6b9 to
68e00d5
Compare
|
Regarding the failed pipeline, I think the reason mine is failing and others are not is because I am on a fork. So something seems to be wrong when using GOPROXY=direct 🤔 |
|
Running go clean -modcache
GOPROXY=direct go mod tidyinside the tests directory reproduces the issue locally |
Aha, yes it does. Nice. |
7d0f00c to
2b87516
Compare
2b87516 to
6ee9a22
Compare
|
A manual change of the checksum could fix this, however that worries me for two reasons:
I've opened tsenart/vegeta#739 to see about this. In the meantime, in order to get this fix merged in, I'll open a PR in the upstream repo and add you as the commit author. |
|
This seems to be the diff between the version in sum.golang.org and direct: GOPROXY=https://proxy.golang.org GOSUMDB=sum.golang.org \
GOPATH=/tmp/gopath-old \
go mod download github.com/tsenart/vegeta/v12@v12.13.0
GOPROXY=direct GONOSUMDB=github.com/tsenart/vegeta \
GOPATH=/tmp/gopath-new \
go mod download github.com/tsenart/vegeta/v12@v12.13.0
diff -ru /tmp/gopath-old/pkg/mod/github.com/tsenart/vegeta/v12@v12.13.0 /tmp/gopath-new/pkg/mod/github.com/tsenart/vegeta/v12@v12.13.0Seems to be this commit: tsenart/vegeta@507c4f0 |
|
That commit did go into the most recent release, so I'm wondering how the checksums ended up differing. |
|
They probably force pushed the tag |
|
Well I'm not sure what just happened, but the pipeline ran and passed those checks now. Seemed timed perfectly with when I opened the PR in the main repo... |
|
Oh interesting, it seems to be running while referencing my other PR, maybe due to the shared commit. I'm just going to reopen that one. |
Proposed changes
Problem: nginx expects IPv6 DNS resolvers to be passed with [] brackets:
invalid port in resolver \"2606:4700:4700::1111\" in /etc/nginx/stream-conf.d/stream.confBut passing resolvers with brackets is not possible:
gatewayClassNp="&{Source:0xc0014382c0 ErrMsgs:[spec.dnsResolver.addresses[0].value: Invalid value: \"[2606:4700:4700::1111]\": must be a valid IP address] Valid:false}"Solution: detect IPv6 resolvers and add brackets in the config templating.
Testing: deployed on an IPv6 capable cluster and configured DNS resolvers using the helm chart, deployed a gateway and http route pointing to an ExternalName service (which requires configuring a DNS resolver).
Fixes #4369
Checklist
Before creating a PR, run through this checklist and mark each as complete.
Release notes
If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.