Commit Graph

55244 Commits

Author SHA1 Message Date
Albin Kerouanton
ddc3603647 Merge pull request #51425 from thaJeztah/no_pointer_slice_step2
daemon: reduce use of pointer-slices in backend
2025-11-14 12:01:45 +01:00
Sebastiaan van Stijn
611c7dce43 client: export fallbackAPIVersion as MinAPIVersion
Export the const and rename it to better reflect its intent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-14 10:26:37 +01:00
Paweł Gronowski
cb6c1c3aca Merge pull request #51516 from vvoland/51492-docker-29.x
[docker-29.x backport] daemon: Fix image store choice priority for prior graphdriver state
2025-11-14 09:25:54 +01:00
Paweł Gronowski
2a18530fb2 Merge pull request #51513 from vvoland/51503-docker-29.x
[docker-29.x backport] hack/test/unit: Fix api and client module testing without replace rules
2025-11-14 09:25:21 +01:00
Paweł Gronowski
14c4e0d73a Merge pull request #51514 from vvoland/51493-docker-29.x
[docker-29.x backport] c8d/builder-next: Don't force unpack
2025-11-14 09:25:01 +01:00
Rob Murray
d23fd38f8b Merge pull request #51515 from vvoland/51495-docker-29.x
[docker-29.x backport] libnet: create DNS records on sbJoin (if not agent node)
2025-11-13 22:35:23 +00:00
Sebastiaan van Stijn
16880e9e1b Merge pull request #51512 from thaJeztah/client_test_cleanups
client: assorted test-cleanups and fixes
2025-11-13 21:01:42 +01:00
Cory Snider
4535d63c91 daemon: install OpenCensus-to-OTEL trace bridge
Export trace spans from the github.com/microsoft/hcsshim module, which
is instrumented with OpenCensus, to the daemon's OpenTelemetry exporter
to provide more visibility into Windows container lifecycle operations.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-11-13 15:00:05 -05:00
Sebastiaan van Stijn
0af2962fdd daemon: reduce use of pointer-slices in backend
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-13 20:52:15 +01:00
Paweł Gronowski
3076530aa6 daemon: Fix image store choice priority for prior graphdriver state
The priority order for determining image store choice was incorrect when
a prior graphdriver existed.

The issue occurred because the prior graphdriver check happened after
processing explicit driver configuration, effectively ignoring user
intent when prior state existed.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 391247ce96)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-13 20:44:49 +01:00
Paweł Gronowski
7a3cdd2c86 daemon: Add TestDetermineImageStoreChoice
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit c5d0e3e6fa)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-13 20:44:37 +01:00
Albin Kerouanton
d7b6f3a7d3 inte/networking: TestDisableIPv6OnInterface: add '-c1' to ping
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 53ea70ea46)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-13 20:44:17 +01:00
Albin Kerouanton
7f5694cda1 inte/networking: test DNS resolution for non swarm-scoped nws
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 47bd247d4d)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-13 20:44:16 +01:00
Albin Kerouanton
0e2d804e48 libnet: create DNS records on sbJoin (if not agent node)
Commit a8b9eff90 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 2e41476a5f)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-13 20:44:09 +01:00
Paweł Gronowski
7242ccd7a0 c8d/builder-next: Don't force unpack
The image exporter wrapper was unconditionally setting `unpack=true` for
all build exports, preventing users from controlling this behavior
through buildkit's output image exporter option.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit b4f9bd1cb3)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-13 20:43:42 +01:00
Paweł Gronowski
b6705d5e1a hack/test/unit: Fix api and client module testing without replace rules
Running sub-package tests from the root module without readding the
replace rules wasn't running the tests from the local in-tree versions
of these submodules.

Fix by cd-ing into their directories before running tests.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 0f597561e8)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-13 20:42:58 +01:00
Paweł Gronowski
feba59eccd Merge pull request #51492 from vvoland/c8d-fix-selection
daemon: Fix image store choice priority for prior graphdriver state
2025-11-13 20:19:25 +01:00
Albin Kerouanton
d494784654 Merge pull request #51495 from akerouanton/revert-a8b9eff90
libnet: create DNS records on sbJoin (if not agent node)
2025-11-13 20:02:28 +01:00
Albin Kerouanton
53ea70ea46 inte/networking: TestDisableIPv6OnInterface: add '-c1' to ping
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>
2025-11-13 18:42:11 +01:00
Albin Kerouanton
47bd247d4d inte/networking: test DNS resolution for non swarm-scoped nws
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>
2025-11-13 18:42:11 +01:00
Albin Kerouanton
2e41476a5f libnet: create DNS records on sbJoin (if not agent node)
Commit a8b9eff90 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>
2025-11-13 17:31:13 +01:00
Sebastiaan van Stijn
94e83af71a client: TestImageListWithSharedSize: merge with TestImageList
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-13 15:57:24 +01:00
Sebastiaan van Stijn
62589a6961 client: TestTLSCloseWriter: cancel context after test
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-13 15:46:54 +01:00
Sebastiaan van Stijn
a5dec0a779 client: make sure context is canceled for ContainerWait tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-13 15:44:09 +01:00
Sebastiaan van Stijn
76a4381d45 client: TestImageListWithSharedSize slight reformat
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-13 15:43:13 +01:00
Sebastiaan van Stijn
9af7fbff2a client: TestImageList: use subtests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-13 15:43:13 +01:00
Sebastiaan van Stijn
7a3b88d91c Merge pull request #51500 from thaJeztah/client_rename_api_options
client: rename/deprecate WithVersion, WithVersionFromEnv
2025-11-13 15:19:08 +01:00
Sebastiaan van Stijn
4a57a8cd7c Merge pull request #51504 from vvoland/hack-check-module-replace
hack/validate: Check if replace rules are needed
2025-11-13 15:17:11 +01:00
Sebastiaan van Stijn
f95781f0d2 Merge pull request #51506 from jsternberg/vendor-buildkit
vendor: github.com/moby/buildkit v0.26.0
2025-11-13 13:59:02 +01:00
Sebastiaan van Stijn
a6b42c090b Merge pull request #51503 from vvoland/fix-apiclient-unitest
hack/test/unit: Fix api and client module testing without replace rules
2025-11-13 13:54:06 +01:00
Paweł Gronowski
391247ce96 daemon: Fix image store choice priority for prior graphdriver state
The priority order for determining image store choice was incorrect when
a prior graphdriver existed.

The issue occurred because the prior graphdriver check happened after
processing explicit driver configuration, effectively ignoring user
intent when prior state existed.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-13 10:05:49 +01:00
Paweł Gronowski
c5d0e3e6fa daemon: Add TestDetermineImageStoreChoice
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-13 10:05:49 +01:00
Jonathan A. Sternberg
17a3357e32 vendor: github.com/moby/buildkit v0.26.0
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-11-12 15:53:45 -06:00
Sebastiaan van Stijn
dae3650dcc client: rename/deprecate WithVersion, WithVersionFromEnv
Add WithAPIVersion and WithAPIVersionFromEnv to be more clear on
the intent, and to align with other related options and fields.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 22:39:05 +01:00
Sebastiaan van Stijn
e5db2380f5 client: rename options.go to client_options.go
Make sure the options are next to the client.go file, which use the
consumer of these options.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 22:39:02 +01:00
Paweł Gronowski
5cf1fb3954 hack/validate: Check if replace rules are needed
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-12 21:43:24 +01:00
Paweł Gronowski
0f597561e8 hack/test/unit: Fix api and client module testing without replace rules
Running sub-package tests from the root module without readding the
replace rules wasn't running the tests from the local in-tree versions
of these submodules.

Fix by cd-ing into their directories before running tests.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-12 21:38:59 +01:00
Albin Kerouanton
27cefe6c43 Merge pull request #51499 from thaJeztah/fix_example
client: fix example in README (align with ExampleNew())
2025-11-12 21:05:52 +01:00
Sebastiaan van Stijn
2729703967 client: fix example in README (align with ExampleNew())
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 20:31:04 +01:00
Sebastiaan van Stijn
8f572f33fd Merge pull request #51502 from thaJeztah/fix_imports
client: fix unused imports
2025-11-12 20:22:00 +01:00
Sebastiaan van Stijn
9824080b57 Merge pull request #51012 from tonistiigi/attestation-signature-referrers
image: pull/load/save attestation manifest and signatures with image
2025-11-12 18:04:21 +01:00
Sebastiaan van Stijn
b29990916d client: fix unused imports
this was introduced in c950796596, but
likely due to the "replace" rules not being present, CI tested the
current version of the module instead of the code in the repository.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 17:53:36 +01:00
Sebastiaan van Stijn
b2d01d9907 Merge pull request #51497 from thaJeztah/add_replace
go.mod: add back replace rules
2025-11-12 17:23:54 +01:00
Tonis Tiigi
47e852f061 image: pull/load/save attestation manifest and signatures with image
Updates docker pull to pull related attestation manifest and
any signatures for that manifest in cosign referrer objects.

These objects are transferred with the image when running
docker save and docker load and can be used to identify
the image in future updates.

Push is not updated atm as the currect push semantics
in containerd mode do not have correct immutability
guaranteed and don't work with image indexes.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-11-12 07:53:46 -08:00
Paweł Gronowski
70cd42fd30 Merge pull request #51493 from vvoland/c8d-build-noforceunpack
c8d/builder-next: Don't force unpack
2025-11-12 16:39:52 +01:00
Sebastiaan van Stijn
16b95ba758 go.mod: add back replace rules
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 15:43:16 +01:00
Paweł Gronowski
b4f9bd1cb3 c8d/builder-next: Don't force unpack
The image exporter wrapper was unconditionally setting `unpack=true` for
all build exports, preventing users from controlling this behavior
through buildkit's output image exporter option.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-12 14:34:12 +01:00
Paweł Gronowski
e7d7771bce Merge pull request #51483 from thaJeztah/rm_MinConnectTimeout
daemon: remove workaround for c8d client connection timeout
2025-11-12 11:01:16 +01:00
Sebastiaan van Stijn
fb2ca99227 Merge pull request #51411 from tonistiigi/update-buildkit-v0.26.0-rc1
vendor: update buildkit v0.26.0-rc2
2025-11-12 01:05:05 +01:00
Tonis Tiigi
3874ca5984 vendor: update buildkit to v0.26.0-rc2
Currently requires replace rule for swarmkit etcd.

BuildKit itself doesn't use etcd but version gets bumped
via unused dependency.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-11 23:15:07 +01:00