Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[docker-29.x backport] libnet: create DNS records on sbJoin (if not agent node)#51515

Merged
robmry merged 3 commits into
moby:docker-29.xmoby/moby:docker-29.xfrom
vvoland:51495-docker-29.xvvoland/moby:51495-docker-29.xCopy head branch name to clipboard
Nov 13, 2025
Merged

[docker-29.x backport] libnet: create DNS records on sbJoin (if not agent node)#51515
robmry merged 3 commits into
moby:docker-29.xmoby/moby:docker-29.xfrom
vvoland:51495-docker-29.xvvoland/moby:51495-docker-29.xCopy head branch name to clipboard

Conversation

@vvoland

@vvoland vvoland commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

- What I did

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, and add an integration test.

- Human readable description for the release notes

Fix a bug preventing DNS resolution of containers attached to non swarm-scoped networks once the node has joined a Swarm cluster

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>

@akerouanton akerouanton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vvoland
vvoland marked this pull request as ready for review November 13, 2025 19:50
@vvoland vvoland added this to the 29.0.1 milestone Nov 13, 2025
@robmry
robmry merged commit d23fd38 into moby:docker-29.x Nov 13, 2025
266 of 278 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.