-
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
base: main
Are you sure you want to change the base?
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. |
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.