Commit Graph

53666 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
0153bebebb Merge pull request #50547 from thaJeztah/internal_stack
pkg/stack: move to daemon/internal
2025-07-28 20:44:35 +02:00
Sebastiaan van Stijn
0075bafe0c Merge pull request #50548 from thaJeztah/rm_stringid_stdcopy
remove pkg/stringid, pkg/stdcopy as they moved to the client and api modules
2025-07-28 20:42:45 +02:00
Sebastiaan van Stijn
17959aff2c remove pkg/stdcopy as it has moved to the api module
pkg/stdcopy moved to github.com/moby/moby/api/stdcopy, and the 28.4
transitional releasee will provide an alias for those that use
github.com/docker/docker as dependency, so we can remove the alias
for the moby module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 19:02:00 +02:00
Sebastiaan van Stijn
c055c3e098 remove pkg/stringid as it has moved to the client module
pkg/stringid moved to github.com/moby/moby/client/pkg/stringid, and
the 28.4 transitional releasee will provide an alias for those that
use github.com/docker/docker as dependency, so we can remove the
alias for the moby module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 19:00:17 +02:00
Sebastiaan van Stijn
76e2ca1d41 pkg/stack: move to daemon/internal
This package is used by the daemon to produce a stack-dump, It has no
external consumers, so we can move it to daemon/internal.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 18:39:22 +02:00
Sebastiaan van Stijn
f78d595c96 runconfig: move to daemon/internal/runconfig
The runconfig package is used by the "container" router to unmarshal, normalize,
and validate a container.CreateRequest. The router converts the result to a
backend.ContainerCreateConfig to be passed on to the backend (daemon).

This package could possibly be part of the router itself, or moved to an
internal package in the server, but we don't have an internal package
there yet.

Put it in daemon/internal for now, which still leaves our options open.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 18:32:15 +02:00
Sebastiaan van Stijn
75bc4c5292 daemon/server/router/container: request sysInfo from daemon / backend
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 18:32:14 +02:00
Sebastiaan van Stijn
02867f9473 runconfig: rewrite ContainerDecoder to DecodeCreateRequest
Now that we no longer need the ContainerDecoder interface, we can
simplify this to just a function; effectively the ContainerDecoder
had three tasks;

- decode a container.CreateRequest
- validate the hostConfig
- split the container.CreateRequest to Config, HostConfig, and NetworkingConfig

Rewrite this to a DecodeCreateRequest function that returns
a DecodeCreateRequest.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 18:32:14 +02:00
Sebastiaan van Stijn
5e567a3856 daemon/server/httputils: remove ContainerDecoder interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 18:32:14 +02:00
Sebastiaan van Stijn
1d6d8f390f Merge pull request #50495 from thaJeztah/move_back_StateStatus_take2
api/types/container: move StateStatus, NewStateStatus internal again
2025-07-28 17:30:48 +02:00
Sebastiaan van Stijn
ec3e83a7b5 api/types/container: move StateStatus, NewStateStatus internal again
These types used to be internal to the container package, but were
moved to the API in 100102108b.

However, the `StateStatus` type is only used internally; it's used
as an intermediate type because [`container.State`] contains a sync.Mutex
field which would make copying it unsafe (see [moby@2998945]).

This moves the type and re-introduces an internal type
in the original location, effectively reverting
100102108b

[`container.State`]: 19e79906cb/container/state.go (L15-L23)
[moby@2998945]: 2998945a54

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 13:57:10 +02:00
Sebastiaan van Stijn
25e2b4d485 Merge pull request #50540 from thaJeztah/fix_vendor
fix vendor
2025-07-28 13:56:25 +02:00
Rob Murray
3555bb4193 Merge pull request #50539 from robmry/iptables_remove_unused_sctp_checksum
iptables: remove deprecated SCTP checksum rule
2025-07-28 12:19:28 +01:00
Sebastiaan van Stijn
a362ae937b Merge pull request #50532 from thaJeztah/runconfig_rm_errors
runconfig: remove exported errors
2025-07-28 12:46:28 +02:00
Sebastiaan van Stijn
bc6851e5a1 Merge pull request #50521 from thaJeztah/move_StatsResponseReader
api/types/container.StatsResponseReader: move to client
2025-07-28 12:31:33 +02:00
Sebastiaan van Stijn
dbfe7649e0 Merge pull request #50525 from thaJeztah/migrate_defaultshmsize_test
integration-cli: migrate TestPostContainersCreateShmSizeXXX to integration
2025-07-28 12:17:17 +02:00
Sebastiaan van Stijn
667cb4bec8 fix vendor
follow-up to e6298db297, which for some
reason didn't cause CI to fail.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 11:53:45 +02:00
Sebastiaan van Stijn
26fda349b8 runconfig: remove exported errors
These errors were not used as sentinel error, and used as any other
"invalid parameter" / "invalid argument" error, so remove them, and
just produce errors where used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 11:46:19 +02:00
Sebastiaan van Stijn
bf8b738ed5 Merge pull request #50458 from thaJeztah/commit_simplify
daemon/server/router/container: postCommit: only decode Config
2025-07-28 11:30:51 +02:00
Rob Murray
969b293778 iptables: remove SCTP checksum rule
Since 28.0.0, an iptables rule related to SCTP has only been
included if escape hatch variable DOCKER_IPTABLES_SCTP_CHECKSUM=1

Nobody's reported that the escape hatch was needed, and the rule
it guards doesn't make sense. So, remove.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-07-28 10:26:01 +01:00
Sebastiaan van Stijn
a7d4b915c3 Merge pull request #50524 from thaJeztah/cleanup_testutils
integration, integration-cli: remove various deprecated test-utilities, and some minor (linting) fixes
2025-07-28 11:11:48 +02:00
Paweł Gronowski
79dd3b0fd3 Merge pull request #50537 from ndeloof/cli
cli/ is not in moby repo (anymore)
2025-07-28 08:49:33 +00:00
Paweł Gronowski
2406d7bdb5 Merge pull request #50534 from thaJeztah/move_backend
api/types: move backend types to daemon/server
2025-07-28 08:42:53 +00:00
Paweł Gronowski
72455d522e Merge pull request #50528 from thaJeztah/checkpoint_no_decoder
daemon/server/router/checkpoint: remove unused httputils.ContainerDecoder
2025-07-28 08:10:57 +00:00
Nicolas De Loof
e6298db297 cli/ is not in moby repo (anymore)
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-07-28 10:01:58 +02:00
Sebastiaan van Stijn
83510a26b3 api/types: move backend types to daemon/server
The "backend" types in API were designed to decouple the API server
implementation from the daemon, or other parts of the code that
back the API server. This would allow the daemon to evolve (e.g.
functionality moved to different subsystems) without that impacting
the API server's implementation.

Now that the API server is no longer part of the API package (module),
there is no benefit to having it in the API module. The API server
may evolve (and require changes in the backend), which has no direct
relation with the API module (types, responses); the backend definition
is, however, coupled to the API server implementation.

It's worth noting that, while "technically" possible to use the API
server package, and implement an alternative backend implementation,
this has never been a prime objective. The backend definition was
never considered "stable", and we don't expect external users to
(attempt) to use it as such.

This patch moves the backend types to the daemon/server package,
so that they can evolve with the daemon and API server implementation
without that impacting the API module (which we intend to be stable,
following SemVer).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 00:03:04 +02:00
Sebastiaan van Stijn
be27300c6e daemon/server/router/checkpoint: remove unused httputils.ContainerDecoder
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-27 15:19:50 +02:00
Sebastiaan van Stijn
b448dc5575 daemon/server/router/container: postCommit: only decode Config
The postCommit used the container-decoder from runconfig to unmarshal
the body. However, this function was written to decode a container
CreateRequest. Commit only accepts a container Config, so we can
just unmarshal to that type.

A local `commitRequest` type was added because the client posts a bare
`*container.Config` but it may be empty / nil (see [Client.ContainerCommit]
and [container.CommitOptions]), in which case it must be ignored, and no
overrides to be applied.

[Client.ContainerCommit]: c4afa77157/client/container_commit.go (L52)
[container.CommitOptions]: c4afa77157/api/types/container/options.go (L30)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-27 14:38:18 +02:00
Sebastiaan van Stijn
6b4dfb0135 integration-cli: migrate TestPostContainersCreateShmSizeXXX to integration
Some of these tests were making assumptions about the daemon's internals
by using `config.DefaultShmSize` from the daemon config package.

Rewrite them to start a daemon with a custom default, and verify the
tests to use that default.

This migrates the following tests from integration-cli to integration;

- `DockerAPISuite.TestPostContainersCreateShmSizeNegative`
- `DockerAPISuite.TestPostContainersCreateShmSizeHostConfigOmitted`
- `DockerAPISuite.TestPostContainersCreateShmSizeOmitted`
- `DockerAPISuite.TestPostContainersCreateWithShmSize`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 20:52:00 +02:00
Sebastiaan van Stijn
617326a40c testutil, integration-cli: fix minor linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 16:34:31 +02:00
Sebastiaan van Stijn
da92ea2837 integration-cli/daemon: rewrite CheckActiveContainerCount with client
Use the API-client instead of shelling out to the CLI.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 16:34:30 +02:00
Sebastiaan van Stijn
6adbeff449 integration-cli: remove parseEventTime utility
It was only used in a single test.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 16:34:30 +02:00
Sebastiaan van Stijn
281a3f6c41 integration-cli: remove deprecaed inspectMountSourceField
The replacement is also deprecated, but at least returns a strong type,
which may help transitioning to using an api-client for these, and
removing one abstraction at a time.

Also rewriting the TestContainerAPIDeleteRemoveVolume to use the API
client (as it's part of the API suite), and touched-up the
TestRunMountShmMqueueFromHost test a bit.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 16:34:24 +02:00
Sebastiaan van Stijn
6124c00827 integration-cli: buildImageSuccessfully: don't wrap buildImage
Both are deprecated, but removing one abstraction at a time.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 13:05:40 +02:00
Sebastiaan van Stijn
877529c62d integration-cli: remove deprecated inspectFieldWithError utility
The replacement is also deprecated, but removing one abstraction at a time

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 13:00:11 +02:00
Sebastiaan van Stijn
68480dc11d integration-cli: remove createTmpFile utility
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 12:48:59 +02:00
Sebastiaan van Stijn
29a7d4039e integration-cli: remove deprecated inspectFieldMap utility
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 12:32:30 +02:00
Sebastiaan van Stijn
d100fd6a77 integration/system: remove "hdr" utility
It was a very shallow wrapper around reading the response
headers, and querying those directly is more transparent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 12:19:22 +02:00
Sebastiaan van Stijn
97827e1a58 integration-cli: TestContainerAPIGetExport: fix minor linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 11:22:42 +02:00
Sebastiaan van Stijn
f73aba83dc client: TestContainerStats: fix minor linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 11:22:42 +02:00
Sebastiaan van Stijn
f67e6555bf api/types/container.StatsResponseReader: move to client
This type was only used in the client, and needs a rewrite; let's
move it to the client first.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 11:22:36 +02:00
Sebastiaan van Stijn
c4afa77157 Merge pull request #50518 from thaJeztah/fix_du_options
api: move "DiskUsage" related types to the right location
2025-07-26 02:02:15 +02:00
Sebastiaan van Stijn
4dda328af8 client: rename files for system-commands to their canonical name
It took me some time to find these commands because they were not named
after their canonical name, unlike (most) other commands.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 00:12:36 +02:00
Sebastiaan van Stijn
96a6884cb3 api/types: move DiskUsage types to api/types/system
Now that the types for the backend were moved to api/types/backend,
we can move the actual response-type and related options to
api/types/system.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 00:12:29 +02:00
Sebastiaan van Stijn
82c069c857 api/types/system: move DiskUsage, DiskUsageOptions to api/types/backend
These types were introduced in f07242f6d7,
but while their description mentions it's the type used for the
response, it actually isn't, and it's used by the backend, but
ultimately marshaled to the "types.DiskUsage" struct;

7dc46c6e0c/daemon/server/router/system/system_routes.go (L254-L270)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 00:09:24 +02:00
Sebastiaan van Stijn
436a546c30 Merge pull request #50510 from corhere/kill-api-types-client
api/types: move client.go contents into moby/moby/client
2025-07-26 00:05:18 +02:00
Sebastiaan van Stijn
58bd636c3d Merge pull request #50516 from thaJeztah/integration_cli_rm_requirements
integration-cli: remove "requirement" package
2025-07-25 21:09:26 +02:00
Cory Snider
24aa86991c api/types: move PluginCreateOptions to client
While it is imported by both the client and the daemon, values of the
PluginCreateOptions struct are not marshaled or unmarshaled. The only
field is mapped to and from an HTTP query parameter. Furthermore, this
options type is the odd one out: the daemon uses types in
api/types/backend to pass options around for the other plugin lifecycle
operations. Move the PluginCreateOptions type into client, and define a
new PluginCreateConfig struct in api/types/backend for the daemon to use
alongside PluginRmConfig, PluginEnableConfig and PluginDisableConfig.

Signed-off-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-25 19:51:58 +02:00
Cory Snider
b93ad81898 api/types: move plugin client options into client
These types are only consumed by the client, not the daemon.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-07-25 19:51:58 +02:00
Cory Snider
44ae4cd2b7 api/types: move HijackedResponse into client
Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-07-25 19:51:58 +02:00