Commit Graph

54949 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
c950796596 client: use t.Context in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 23:23:23 +01:00
Paweł Gronowski
d105562bef Merge pull request #51466 from vvoland/vendor-client
vendor: github.com/moby/moby/client v0.1.0
docker-v29.0.0 v2.0.0-beta.3
2025-11-10 22:31:38 +01:00
Paweł Gronowski
20b831c59a vendor: github.com/moby/moby/client v0.1.0
full diff: https://github.com/moby/moby/client/compare/da8fb63a73c0...v0.1.0

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-10 22:05:24 +01:00
Paweł Gronowski
818ddd3b27 Merge pull request #51464 from vvoland/vendor-api
vendor: github.com/moby/moby/api v1.52.0
client/v0.1.0
2025-11-10 21:55:07 +01:00
Paweł Gronowski
e0a877b487 vendor: github.com/moby/moby/api v1.52.0
full diff: https://github.com/moby/moby/api/compare/da8fb63a73c0...v1.52.0

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-10 21:46:26 +01:00
Paweł Gronowski
1408c9ca4f Merge pull request #51462 from vvoland/drop-replace
Drop replace rules
api/v1.52.0
2025-11-10 20:16:43 +01:00
Paweł Gronowski
854ccbfcf5 Drop replace rules
Prepare v29.0.0

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-10 19:38:57 +01:00
Paweł Gronowski
c5e3c19bd3 Merge pull request #50942 from Vigilans/vigilans/buildkit-windows-isolation
daemon: Ensure buildkit created container's isolation mode is consistent with daemon's config in Windows
2025-11-10 19:33:43 +01:00
Paweł Gronowski
da8fb63a73 Merge pull request #51460 from thaJeztah/bump_go_version
client, api: update go.mod to go1.24
2025-11-10 19:03:46 +01:00
Sebastiaan van Stijn
15241265dc client, api: update go.mod to go1.24
While go1.23 still works, it's already EOL, so it may be a better
starting point to use that as minimum version for these modules, as
they're brand new.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 18:42:11 +01:00
Sebastiaan van Stijn
ed6d436d51 Merge pull request #51458 from thaJeztah/rm_deprecated_dockerversion
api/types/plugin: remove deprecated Config.DockerVersion
2025-11-10 18:28:56 +01:00
Sebastiaan van Stijn
591b4b003a Merge pull request #51457 from thaJeztah/rm_docker_docs_links
api/docs: remove links to docs.docker.com from changelog
2025-11-10 18:19:15 +01:00
Sebastiaan van Stijn
e8f156110a api/types/plugin: remove deprecated Config.DockerVersion
This was deprecated in c4fda95bea, and
already omitted.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 18:11:45 +01:00
Sebastiaan van Stijn
34fb9de7f3 api/docs: remove links to docs.docker.com from changelog
The docker documentation website may not be publishing rendered versions
of the swagger for deprecated API versions, so let's remove these links
from the changelog.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 18:04:01 +01:00
Vigilans
d192a63467 daemon: Ensure buildkit created container's isolation mode consistent with daemon's config
- Introduced DefaultIsolation method in the Daemon to return the daemon configured isolation mode for Windows.

Signed-off-by: Vigilans <vigilans@foxmail.com>
2025-11-10 16:33:14 +01:00
Paweł Gronowski
7cff366d43 Merge pull request #51439 from thaJeztah/concrete_enums
api/types/container: make ContainerState, HealthStatus concrete types
2025-11-10 16:21:22 +01:00
Paweł Gronowski
f57da07056 Merge pull request #51454 from thaJeztah/api_volumes_no_pointer
api/types/volume: change ListResponse.Volumes to a non-pointer slice
2025-11-10 16:20:16 +01:00
Sebastiaan van Stijn
db71c6a914 api/types/container: make HealthStatus a concrete type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 16:08:15 +01:00
Sebastiaan van Stijn
1fd87e9fdf api/types/container: make ContainerState a concrete type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 16:08:12 +01:00
Rob Murray
69c4524355 Merge pull request #51437 from thaJeztah/diskusage_move_legacy
api: remove / internalize LegacyDiskUsage
2025-11-10 15:03:37 +00:00
Paweł Gronowski
412a3a229d Merge pull request #51451 from thaJeztah/test_adjustments
assorted test-changes in preparation of updating integration-cli CLI version
2025-11-10 15:52:58 +01:00
Sebastiaan van Stijn
048ced8435 Merge pull request #51448 from akerouanton/stop-events-service
daemon: close EventsService on shutdown
2025-11-10 14:20:28 +01:00
Paweł Gronowski
75cf7c2544 Merge pull request #51450 from thaJeztah/checkpoint_client
client: checkpoint: add output structs and fix naming
2025-11-10 13:49:45 +01:00
Sebastiaan van Stijn
18000fe371 api/types/volume: change ListResponse.Volumes to a non-pointer slice
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 13:13:22 +01:00
Sebastiaan van Stijn
fe1a505cbf simplify some commit tests, and work around change in CLI behavior
These tests were failing because the "docker run" did not print the
ID of the container, and instead detached immediately without printing;

```
=== Failed
=== FAIL: amd64.integration-cli TestDockerCLICommitSuite/TestCommitAfterContainerIsDone (0.27s)
    docker_cli_commit_test.go:32: assertion failed:
        Command:  /usr/local/cli-integration/docker wait
        ExitCode: 1
        Error:    exit status 1
        Stdout:
        Stderr:   invalid container name or ID: value is empty

        Failures:
        ExitCode was 1 expected 0
        Expected no error
    --- FAIL: TestDockerCLICommitSuite/TestCommitAfterContainerIsDone (0.27s)

=== FAIL: amd64.integration-cli TestDockerCLICommitSuite/TestCommitWithoutPause (0.20s)
    docker_cli_commit_test.go:47: assertion failed:
        Command:  /usr/local/cli-integration/docker wait
        ExitCode: 1
        Error:    exit status 1
        Stdout:
        Stderr:   invalid container name or ID: value is empty

        Failures:
        ExitCode was 1 expected 0
        Expected no error
    --- FAIL: TestDockerCLICommitSuite/TestCommitWithoutPause (0.20s)
```

What happens is that it starts a container with only `stdin` attached, but
no `stdout`, and the behavior changed between versions of the CLI, which
may be either a bugfix or a regression;

docker 28 cli doesn't stay attached:

```bash
Status: Downloaded newer image for docker:28-cli
/ # docker run -i -a stdin busybox echo foo
/ #
```

docker 27 cli stays attached, but has the "three strikes, you're out" handling:

```bash
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock docker:27-cli sh
Status: Downloaded newer image for docker:27-cli
/ # docker run -i -a stdin busybox echo foo
9dbb29080a72225593885bc4880d8f4f22f36803100179f9725468bda1d52b4f

^C^C^C
got 3 SIGTERM/SIGINTs, forcefully exiting
/ # ^C
```

docker 26 cli (and older) don't forward the signal to the container, and detach-keys don't work (or in this case, are handled by the CLI container)?:

```bash
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock docker:26-cli sh
Status: Downloaded newer image for docker:26-cli
/ # docker run -i -a stdin busybox echo foo
21963ce1b9a7bb7eccef3618693b09a106fb29084b484e31c69cd4a26ee44777
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C

<CTRL>p,q
```

As these tests were not testing that part, I simplified the tests, but
we should probably look into the change of behavior to see if it was
intentional (and if it was correct).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:14 +01:00
Sebastiaan van Stijn
c477a68fb9 TestBuildForceRm: use assert to help debugging failures
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:13 +01:00
Sebastiaan van Stijn
b0ab0b4078 TestBridgeIPIsExcludedFromAllocatorPool: don't use deprecated fields
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:13 +01:00
Sebastiaan van Stijn
9b7452e903 TestDockerNetworkValidateIP: relax string-matching errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:13 +01:00
Sebastiaan van Stijn
82a5eec1aa DockerSwarmSuite: relax string-matching errors and output
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:13 +01:00
Sebastiaan van Stijn
2e3c523579 TestAttachPausedContainer: relax error-message matching
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:12 +01:00
Sebastiaan van Stijn
598618b6f2 TestBuildWithInaccessibleFilesInContext: use sub-tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:12 +01:00
Paweł Gronowski
a0e4debdfc Merge pull request #51440 from thaJeztah/plugins_no_pointer
api, client: don't use a pointer-slice for plugins
2025-11-10 12:18:57 +01:00
Paweł Gronowski
22112fab66 Merge pull request #51444 from thaJeztah/buildcache_singleflight
daemon/internal/builder-next: Builder.DiskUsage(): use singleflight
2025-11-10 12:02:07 +01:00
Paweł Gronowski
6ad7dcc180 Merge pull request #51443 from thaJeztah/fix_singleflight
daemon: disk-usage: fix incorrect key for singleflight
2025-11-10 11:53:17 +01:00
Sebastiaan van Stijn
7aa036ef2e client: rename CheckpointDelete to CheckpointRemove, and add output struct
Align with other "delete" options, which are all named "remove".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 11:42:27 +01:00
Sebastiaan van Stijn
e2bdc51508 client: CheckpointCreate: add output struct
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 11:42:23 +01:00
Sebastiaan van Stijn
da25838fc3 client: CheckpointListResult: rename Checkpoints to Items
Align with other ListResult structs

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 11:23:34 +01:00
Sebastiaan van Stijn
fda54735c9 client: move CheckpointAPIClient together with other interfaces
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 11:19:12 +01:00
Albin Kerouanton
d087d3c057 daemon: close EventsService on shutdown
On daemon shutdown, the HTTP server tries to gracefully shutdown for 5
seconds. If there's an open API connection to the '/events' endpoint, it
fails to do so as nothing interrupts that connection, thus forcing the
daemon to wait until that timeout is reached.

Add a Close method to the EventsService, and call it during daemon
shutdown. It'll close any events channel, signaling to the '/events'
handler to return and close the connection.

It now takes ~1s (or less) to shutdown the daemon when there's an active
'/events' connection, instead of 5.

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
2025-11-09 22:38:59 +01:00
Sebastiaan van Stijn
46090e88e4 daemon/internal/builder-next: Builder.DiskUsage(): use singleflight
Use a singleflight for collecting the build-cache usage; collecting this
information is potentially heavy-weight, and we already do this for the
other disk-usage methods.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 21:32:23 +01:00
Sebastiaan van Stijn
fb94e241f5 daemon: disk-usage: fix incorrect key for singleflight
commit a69abdd90d introduced a "verbose"
option for the disk-usage endpoint, which allowed omitting the items
to be included in the results.

However, it did not take into account that a singleflight is used to
allow sharing the results between requests; this means that a request
made while another request is already in flight could share the wrong
results, and either get "verbose" or "non-verbose", depending on the
request already in flight.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 21:21:32 +01:00
Sebastiaan van Stijn
15a048c396 api, client: don't use a pointer-slice for plugins
The backend and router don't use a pointer-slice (the server actually
doesn't use the `plugin.ListResponse` type and a straight slice);
778e5bfad3/daemon/server/router/plugin/backend.go (L20)
6baf274fa3/daemon/server/router/plugin/plugin_routes.go (L276-L280)

Align the type in the API to match, and update the type defined in the
client accordingly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 21:02:26 +01:00
Sebastiaan van Stijn
ed428234bd api: remove / internalize LegacyDiskUsage
These fields have been removed from the API specification, and the struct
was only needed to produce legacy responses (server), or to unmarshal
legacy responses in the client.

As the API module only provides API definitions for the current API version,
we should remove these legacy structs, and keep them internal to the daemon
and client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 20:16:03 +01:00
Sebastiaan van Stijn
4dc87c55c7 Merge pull request #51436 from thaJeztah/backend_buildcache
daemon: refactor disk-usage endpoint
2025-11-07 20:15:35 +01:00
Sebastiaan van Stijn
71bcd22d6d daemon/server/router/system: simplify constructing response
Now that we separated the legacy response from non-legacy responses,
we can consume the data produced by the backend as-is; the backend
takes care of omitting "verbose" data (leaving the `Items` slices
empty), and with an early return for the legacy responses, we won't
end up with returning _both_ responses on API < v1.52, but (TBD) still
return both responses for API v1.52.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:40 +01:00
Sebastiaan van Stijn
f5e319c950 daemon/server/router/system: use early return for disk-usage
Use early return for legacy response. When using API < v1.52, we'd
never return the new fields, so we can return early, and produce the
legacy-fields only.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:39 +01:00
Sebastiaan van Stijn
20870f13c2 daemon: remove intermediate vars when collecting diskUsage
Set values directly on the DiskUsage objects instead of using some
intermediate vars, some of which were named slightly confusing due
to them being used both for "totalSize" and "reclaimableSize".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:36 +01:00
Sebastiaan van Stijn
0dcb1fe344 daemon: align build.DiskUsage() with other disk-usages
Move calculation of the data to the builder backend, to align with
the other type of objects. This also allows us to skip the verbose
data if it's not used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:30 +01:00
Sebastiaan van Stijn
f1a3387633 daemon/server/backend: align DiskUsage types with api
Make the "per-object" types aliases for the API type, and remove
the BuildCacheDiskUsage type, as it's not currently used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:13 +01:00
Sebastiaan van Stijn
04de584531 daemon/server/router/system: use shorter names and comments
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:56:55 +01:00