Commit Graph

253 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
2d1af4e4e4 api/types/build: move build options to client and backend
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-05 15:57:05 +02:00
Sebastiaan van Stijn
4d20b6fe56 api/types/container: move container options to client
Move the option-types to the client and in some cases create a
copy for the backend. These types are used to construct query-
args, and not marshaled to JSON, and can be replaced with functional
options in the client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-04 20:09:55 +02:00
Albin Kerouanton
0ca7ac3258 daemon: backfill empty PBs slices for backward compat
So far, on ContainerStart, the daemon was silently backfilling empty
PortBindings slices with a PortBinding with unspecified HostIP and
HostPort. This was done by github.com/docker/go-connections/nat.SortPortMap.

This backfilling doesn't make much sense, and we're trying to remove
that package. So, move the backfilling to the API server, keep it for
older API versions, deprecate it for API 1.52, and drop it for API 1.53
and above.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-02 22:45:04 +02:00
Albin Kerouanton
d0de293513 testutil/daemon: remove unused FindContainerIP
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 15:21:50 +02:00
Sebastiaan van Stijn
6288414110 Merge pull request #50776 from austinvazquez/move-image-options-from-api-to-client
api/types/image: move image options from api to client
2025-08-27 00:45:28 +02:00
Austin Vazquez
853aed171b api/types/image: move image option types to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 15:38:44 -05:00
Austin Vazquez
33066cddb1 api/types/swarm: move SecretListOptions type to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 14:15:35 -05:00
Austin Vazquez
94d0b10503 api/types/swarm: move ServiceInspectOptions type to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:46 -05:00
Austin Vazquez
a2291e5eac api/types/swarm: move ServiceListOptions type to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:40 -05:00
Austin Vazquez
3b1e16594b api/types/swarm: move ServiceUpdateOptions type to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:33 -05:00
Austin Vazquez
bb4125e89f api/types/swarm: move ServiceCreateOptions type to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:33 -05:00
Austin Vazquez
4dcc7af116 api/types/swarm: move UpdateFlags type to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:23 -05:00
Austin Vazquez
ad0fa5a872 api/types/swarm: move TaskListOptions type to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:17 -05:00
Austin Vazquez
2718f953f0 api/types/swarm: move NodeRemoveOptions to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:17 -05:00
Austin Vazquez
7d2b87e95f api/types/swarm: move NodeListOptions to client mod
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:12 -05:00
Austin Vazquez
b1260cd493 api/types/swarm: move ConfigListOptions to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:05 -05:00
Sebastiaan van Stijn
b3a701a8a1 Merge pull request #50786 from austinvazquez/move-network-options-from-api-to-client
api/types/network: move network options from api to client
2025-08-22 23:19:31 +02:00
Sebastiaan van Stijn
aadb486522 Merge pull request #50727 from thaJeztah/frozen_trixie
Dockerfile: update debian frozen image to trixie-slim
2025-08-22 16:51:03 +02:00
Austin Vazquez
6084c6ae78 client: refactor ListOptions to NetworkListOptions
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-22 09:38:53 -05:00
Austin Vazquez
d6aa6ae9bd api/types/network: move ListOptions to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-22 09:38:47 -05:00
Austin Vazquez
ee22a62dd5 client: refactor ListOptions to VolumeListOptions
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-21 21:47:59 -05:00
Austin Vazquez
c48585f104 api/types/volume: move ListOptions to client mod
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-21 21:46:19 -05:00
Sebastiaan van Stijn
39d4dbea9c Dockerfile: update debian frozen image to trixie-slim
docker buildx imagetools inspect docker.io/library/debian:trixie-slim
    Name:      docker.io/library/debian:trixie-slim
    MediaType: application/vnd.oci.image.index.v1+json
    Digest:    sha256:c85a2732e97694ea77237c61304b3bb410e0e961dd6ee945997a06c788c545bb

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-21 23:35:26 +02:00
Derek McGowan
8700bca2bf Update migration test to use graphdriver env
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-08-08 12:07:42 -07:00
Sebastiaan van Stijn
9d167847d0 Merge pull request #50654 from thaJeztah/fix_fakestorage
testutil/fakestorage: use local paths, fix port-mapping and optimize, and remove contrib/httpserver
2025-08-08 19:26:42 +02:00
Matthieu MOREL
96f8c6395e chore: enable use-any rule from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-08-08 17:07:07 +02:00
Sebastiaan van Stijn
50789e2bab testutil/fakestorage: inline go code and remove contrib/httpserver
It's 12 lines of code total; we may as well write it as part of building;
it looks to be the only place this is used, so we can remove the contrib
directory, which should not be used by anyone.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-07 22:04:09 +02:00
Sebastiaan van Stijn
d49a354cb2 testutil/fakestorage: use local paths, fix port-mapping and optimize
- always build the go binary, instead of trying to find if it exists
  and then trying to copy it.
- write the Dockerfile ourselves, instead of trying to copy the one
  from contrib.
- update the Dockerfile to be built "FROM scratch"; we don't need
  busybox here.
- start the container with "PublishAllPorts: true", otherwise no
  ports would be mapped.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-07 22:04:09 +02:00
Sebastiaan van Stijn
c145229828 update some fixtures in tests
updated TestModuleVersion fixture (looks like the test doesn't really care :D)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-05 20:54:36 +02:00
Sebastiaan van Stijn
c13266d2c0 api/types: move plugin types to api/types/plugin
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-05 15:42:57 +02:00
Cory Snider
ee560a3b23 api/types: fix Plugin.Config.Interface.Types def'n
The wire type of Plugin.Config.Interface.Types is an array of strings,
not of objects with three properties. We just so happen to have a Go
struct type to represent a plugin-interface-type value in memory with
all the fields parsed out for convenience, but that is not part of the
REST API contract documented by the Swager spec.U pdate the Swagger spec
to correctly document that the Types property is an array of strings in
the API, while still generating Go definitions that unmarshal into the
convenient struct type.

Move the definition and marshal/unmarshal methods for
PluginInterfaceType into a more appropriate location than api/types.
Rename the type to one that does not stutter or overload already
heavily overloaded terminology.

Modernize the parser and use property-based testing to assert that it
behaves the same as the old parser for all well-formed inputs.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-08-01 13:37:20 -04:00
Sebastiaan van Stijn
cf15d5bbc6 remove obsolete //go:build tags
These are no longer needed as these are now part of a module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-01 00:49:22 +02:00
Derek McGowan
f74e5d48b3 Create github.com/moby/moby/v2 module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:13:29 -07:00
Sebastiaan van Stijn
d58dc493fe replace direct uses of nat types for api/types/container aliases
Follow-up to 494677f93f, which added
the aliases, but did not yet replace our own use of the nat types.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-31 02:57:39 +02:00
Derek McGowan
0d8ca8eefe Move pkg/jsonmessage to client/pkg/jsonmessage
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-30 14:22:31 +02: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
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
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
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
Sebastiaan van Stijn
ca1c5ee08f pkg/stringid: move to daemon, and provide copy in client
The stringid package is used in many places; while it's trivial
to implement a similar utility, let's just provide it as a utility
package in the client, removing the daemon-specific logic.

For integration tests, I opted to use the implementation in the
client, as those should not ideally not make assumptions about
the daemon implementation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-25 13:39:32 +02:00
Derek McGowan
713d7f5ed1 Move internal/nlwrap to daemon/libnetwork/nlwrap
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-24 12:13:58 -07:00
Derek McGowan
7bfb804dbe Move registry to daemon/pkg/registry
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-24 12:11:51 -07:00
Rob Murray
090c319f2e Don't allow the daemon to start with nftables and Swarm enabled
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-07-22 09:13:45 +01:00
Rob Murray
26e487db78 testutil: Fix sense of hasFwBackendArg check
Introduced by commit 39ab393 ("Add daemon option --firewall-backend").

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-07-22 09:13:11 +01:00
Sebastiaan van Stijn
daa991c3d8 testutil/environment: don't use regex for string-matching error
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 21:24:11 +02:00
Derek McGowan
c47afd41c8 Create github.com/moby/moby/client module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:30:26 -07:00
Derek McGowan
afd6487b2e Create github.com/moby/moby/api module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:30:05 -07:00
Rob Murray
8c79486dab Merge pull request #50357 from robmry/firewall_backend_option
Add daemon option --firewall-backend
2025-07-17 19:21:12 +01:00
Rob Murray
39ab393274 Add daemon option --firewall-backend
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-07-17 15:12:01 +01:00