[docker-29.x backport] libnet: create DNS records on sbJoin (if not agent node)#51515
Merged
Merged
[docker-29.x backport] libnet: create DNS records on sbJoin (if not agent node)#51515
Conversation
Commit a8b9eff removed a call to Network.updateSvcRecord from Network.createEndpoint on the grounds that: > all callers of Network.createEndpoint follow up with an Endpoint.Join, > which also sets up the DNS entry. However, the original call in Network.createEndpoint was gated by: ``` if !n.getController().isSwarmNode() || n.Scope() != scope.Swarm || !n.driverIsMultihost() { n.updateSvcRecord(context.WithoutCancel(ctx), ep, true) } ``` whereas the call in Endpoint.sbJoin() (invoked by Endpoint.Join()) is gated by: ``` if !n.getController().isAgent() { if !n.getController().isSwarmNode() || n.Scope() != scope.Swarm || !n.driverIsMultihost() { n.updateSvcRecord(context.WithoutCancel(ctx), ep, true) } } ``` As a result, once a node has joined a Swarm cluster, no DNS entries are created for non swarm-scoped networks. Change the condition used by `sbJoin` to match the original condition used in `createEndpoint`. Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com> (cherry picked from commit 2e41476) Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Previous commit reverted a faulty change that broke DNS resolution for non swarm-scoped networks once a node has joined a Swarm cluster. This commit adds an integration test to verify that we don't break DNS resolution again. Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com> (cherry picked from commit 47bd247) Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
If the DNS name still resolves to an IP address, and that address is assigned to a running container, the ping command will run indefinitely and the test suite will time out for 10 mins. This is confusing, as it looks like a daemon hang, or a test suite hang, whereas it's just a test failure. Add '-c1' to ping to make it return immediately. Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com> (cherry picked from commit 53ea70e) Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
vvoland
marked this pull request as ready for review
November 13, 2025 19:50
robmry
approved these changes
Nov 13, 2025
corhere
approved these changes
Nov 13, 2025
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.
backport: libnet: create DNS records on sbJoin (if not agent node) #51495
Fixes DNS resolution broken after
docker swarm init(29.0.0) #51491Related to Release IPv6 address if IPv6 is disabled on an interface #48971
- What I did
Commit a8b9eff removed a call to Network.updateSvcRecord from Network.createEndpoint on the grounds that:
However, the original call in Network.createEndpoint was gated by:
whereas the call in Endpoint.sbJoin() (invoked by Endpoint.Join()) is gated by:
As a result, once a node has joined a Swarm cluster, no DNS entries are created for non swarm-scoped networks.
Change the condition used by
sbJointo match the original condition used increateEndpoint, and add an integration test.- Human readable description for the release notes