Repository navigation
fix: default the server port when it is not set - #289
Merged
Merged
Conversation
A server block without a port rendered Service and container ports as null (udp-<nil>), which the API server rejects. Fall back to the port CoreDNS itself uses for the zone scheme. Fixes coredns#67 Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
hagaibarel
approved these changes
Nov 6, 2026
Collaborator
|
Thanks for the PR! |
Merged
1 task
Merged
1 task
Open
1 task
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why is this pull request needed and what does it do?
portis optional on a server block (the configmap already handles it, and CoreDNS picks the default for the scheme), but the port helpers calltoString .portunconditionally. Without a port the chart renders:which the API server rejects. This adds a small
coredns.serverPorthelper that returns.portwhen set, otherwise the CoreDNS default for the first zone's scheme (53, 853 fortls:///quic://, 443 forgrpc:///https://), and uses it in bothcoredns.servicePortsandcoredns.containerPorts.servicePortstill overrides the Service port.Rendering with the default values is byte for byte the same as before. Added unit tests for the Service and the Deployment with port-less server blocks (they fail without the fix), and updated the
portcomment in values.yaml.Which issues (if any) are related?
Fixes #67
Checklist:
Changes are automatically published when merged to
main. They are not published on branches.Note on DCO
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.