4561 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
139b6464b5 api/docs: fix events example response
Don't include the deprecated `id`, `status`, and `from` fields
in the response; they're no longer part of the API since v1.22
([moby@72f188]).

[moby@72f188]: 72f1881df1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-10 14:37:53 +02:00
Sebastiaan van Stijn
0525ae2aed api: image inspect: remove temporary backfill for Config fields
Commit 4dc961d0e9 (API v1.50) fixed the type
used for Config to point to the correct type, which is the Config struct
from the [Docker image spec] (which embeds the [OCI Image Specification]
type); however, those types use an omitempty, which wasn't documented as
part of the API changes, so f85394dd5d added
a temporary backfill for empty fields.

This removes that backfill for API v1.52 so that empty image config fields
are now omitted.

[OCI Image Specification]: https://github.com/opencontainers/image-spec/blob/v1.1.1/specs-go/v1/config.go#L23-L62
[Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-05 22:15:54 +02:00
Sebastiaan van Stijn
7777b86d53 Merge pull request #50910 from thaJeztah/api_docs_image_config
api/docs: remove temporary "full" example for image config
2025-09-05 19:59:19 +02:00
Sebastiaan van Stijn
ec26e71055 Merge pull request #50911 from thaJeztah/api_swagger_sync
api/docs: sync v1.52 docs with latest
2025-09-05 19:58:57 +02:00
Sebastiaan van Stijn
59c2f2d5bc Merge pull request #50907 from thaJeztah/move_build_options
api/types/build: move build options to client and backend
2025-09-05 19:46:25 +02:00
Sebastiaan van Stijn
a1e3a109ee api/docs: sync v1.52 docs with latest
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-05 19:31:00 +02:00
Sebastiaan van Stijn
0fe1af95f3 api/docs: remove temporary "full" example for image config (v1.50, v1.51)
This example was added in 5e0e34fafd so that
the deprecated fields could be omitted from the example. Those fields were
removed from the swagger in 4dc961d0e9, but
the temporary example was not removed.

This patch removes the example, in favor of the per-field examples, which
were already in place.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-05 19:22:45 +02:00
Sebastiaan van Stijn
7bfbb6e8ca api/swagger: remove temporary "full" example for image config
This example was added in 5e0e34fafd so that
the deprecated fields could be omitted from the example. Those fields were
removed from the swagger in 4dc961d0e9, but
the temporary example was not removed.

This patch removes the example, in favor of the per-field examples, which
were already in place.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-05 19:22:42 +02:00
Sebastiaan van Stijn
4e23f5fd62 Merge pull request #50855 from corhere/network-summary-swagger
api/types/network: generate network-inspect struct definitions from Swagger spec
2025-09-05 19:20:43 +02:00
Austin Vazquez
75fd07c365 Merge pull request #50904 from dmcgowan/prepare-api-1.52-beta
Prepare release notes for api/v1.52.0-beta.0
2025-09-05 10:12:19 -07:00
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
8b8a3cb14c api/types/image: move LoadResponse to client
It's not the response coming from the API, but a wrapper for a response
reader. We should ultimately remove it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-05 15:15:42 +02:00
Sebastiaan van Stijn
a064febe14 Merge pull request #50905 from thaJeztah/move_checkpoint_options
api/types/checkpoint: move checkpoint options to client
2025-09-05 13:01:52 +02:00
Sebastiaan van Stijn
432c9e81d1 Merge pull request #50772 from austinvazquez/move-build-cache-prune-options-from-api-to-client
api/types/build: move build cache prune options from api to client
2025-09-05 10:33:23 +02:00
Sebastiaan van Stijn
a8afc2c6fb api/types/checkpoint: move checkpoint 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.

The CreateOptions type was used both as options-struct for the client,
and as struct to marshal/unmarshal the request. For this type, a copy
is created in the Client and a new `checkpoint.CreateRequest` is added
in the API.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-05 10:20:06 +02:00
Sebastiaan van Stijn
a45639af26 Merge pull request #50897 from thaJeztah/move_container_options
api/types/container: move container options to client
2025-09-05 09:29:56 +02:00
Derek McGowan
d904f3b625 Prepare api/1.52.0-beta releases
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-09-04 22:54:01 -07:00
Cory Snider
e656f39952 api/t/network: generate more structs from Swagger
Replace hand-rolled struct definitions for api/types/network with
types generated from the Swagger definitions:
  - ConfigReference
  - EndpointResource
  - NetworkingConfig
  - PeerInfo
  - ServiceInfo
  - Task

Add Swagger definitions for ServiceInfo and Task.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-09-04 19:46:44 -04:00
Cory Snider
ea1c2530da api/t/network: generate Inspect, Summary structs
Replace the hand-rolled Network, Summary and Inspect struct types in
api/types/network with types generated from the Swagger definition.

Disable the generation of all unwanted marshalers and unmarshalers.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-09-04 19:46:43 -04:00
Austin Vazquez
26e335b647 api/types/build: move CachePruneOptions to client mod
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-09-04 16:33:57 -05:00
Sebastiaan van Stijn
ccf1363680 api/docs: update v1.52 docs with current swagger
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-04 21:52:11 +02:00
Cory Snider
c208f90796 api/templates: vendor structfield template
Taken verbatim from
eee6eaf67f/generator/templates/structfield.gotmpl
so the alterations from the upstream template can be easily diffed.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-09-04 15:38:14 -04:00
Sebastiaan van Stijn
6da8589ebe Merge pull request #50878 from corhere/network-inspect-concrete-type
api/types/network: separate Summary from Inspect
2025-09-04 21:36:00 +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
Austin Vazquez
c441b2ef19 api/types/image: make InspectResponse.GraphDriver optional
This change makes the `GraphDriver` field in `image.InspectResponse` optional. This field will only be returned when using moby engine graph drivers as a backend storage implementation. It will be omitted when using the containerd image backend.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-09-04 13:04:10 -05:00
Cory Snider
1a86389419 api/types/network: separate Summary from Inspect
While the network Summary and Inspect types have been aliases in Go's
type system, in practice there is a difference: the Containers and
Services fields are only populated when inspecting a network. Split out
the common fields into a base network.Network struct which is embedded
in the network.Summary and network.Inspect types.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-09-04 13:51:28 -04:00
Cory Snider
291e129631 Merge pull request #50860 from corhere/network-filter-iface
daemon: filter networks before converting to API types
2025-09-04 13:48:07 -04:00
Cory Snider
f8bd170b2a daemon: validate args in network.New*Filter
Filter-term validation does not belong in the API module. Clients should
not be making any assumptions about which terms the daemon understands.
Users should not need to upgrade their clients to use filter terms
introduced in a newer daemon. Move the network filter validation from
the api module into the daemon.

Split network.NewFilter into network.NewListFilter and
network.NewPruneFilter constructors which validate the filter terms,
enforcing the invariant that any network.Filter is a well-formed filter
for networks.

The network route handlers have been leveraging a hidden 'idOrName'
filter term that is not listed in the set of accepted filters and
therefore not accepted in API client requests. And it's a good thing
that it was never part of the API: it is completely broken and not fit
for purpose! When a filter contains an idOrName term, the term values
are ignored and instead the filter tests whether either the 'id' or
'name' terms match the Name of the network. Unless the filter contains
both 'id' and 'name' terms, the match will evaluate to true for all
networks! None of the daemon-internal users of 'idOrName' set either
of those terms, therefore it has the same effect as if the filter did
not contain the 'idOrName' term in the first place.

Filtering networks by id-or-name is a quirky thing that the daemon needs
to do to uphold its end of the Engine API contract, not something that
would be of use to clients. Fixing up the idOrName filter would
necessitate adding it to the list of accepted terms so the filter passes
validaton, which would have the side effect of also making the filter
available to API clients. Instead, add an exported field to the Filter
struct so that daemon code can opt into the internal-only behaviour of
having the 'id' term match on either the network Name or ID.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-09-04 12:49:31 -04:00
Austin Vazquez
a4a90c2248 api: fix deprecation of "keep-storage" /build/prune query parameter
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-09-04 11:28:10 -05:00
Sebastiaan van Stijn
e46a991dc5 api: remove unused DefaultVersion, MinSupportedAPIVersion consts
These consts are no longer used, and separate consts were added in both
the client and daemon packages;

- client: 41da5700a4
- daemon: a632b8495b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-04 07:30:35 -05:00
Austin Vazquez
e2e9f36c5f api/types/system: move SecurityOpt type and DecodeSecurityOptions to client
This change moves the `system.SecurityOpt` type and `system.DecodeSecurityOptions` function to the client and adds a set of unit tests to capture current implementation. This change also create a set of daemon backend copies for usage.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-09-03 12:49:06 -05: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
Austin Vazquez
229edd0c1c Merge pull request #50826 from austinvazquez/remove-legacy-marshal-json-function
api/types/registry: move `ServiceConfig` legacy field marshaling support into daemon backend
2025-08-29 09:56:45 -07:00
Albin Kerouanton
b7c597ec35 api/t/ctr: deprecate DefaultNetworkSettings
This struct is only used to report the networking state for the default
bridge network when the container is connected to it.

It was deprecated in v1.09 (API v1.21), and scheduled for removal in
v1.11. Unfortunately, the deprecation warning was wrongly formatted in
the Go code. However, deprecation warnings are already present in
swagger.yaml, so don't touch it.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 15:40:45 +02:00
Austin Vazquez
c9fdad2552 daemon: marshal legacy registry.ServiceConfig extra fields for compatability
This change moves the logic that is used to marshal the legacy extra fields for `registry.ServiceConfig` type to the daemon backend.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-29 08:23:34 -05:00
Albin Kerouanton
80bb864fd6 api/t/ctr: deprecate NetworkSettingsBase
Most fields in NetworkSettingsBase are deprecated, so deprecate the
whole struct. The few fields which aren't deprecated will move to the
NetworkSettings struct in v29.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 15:21:34 +02:00
Albin Kerouanton
16dc39136c api/t/ctr: deprecate NetworkSettingsBase.Bridge
This field provides little value as it's only set when the daemon is
started with --bridge flag specified, and the inspected container is
connected to the default bridge network.

Unfortunately, there's no equivalent field in NetworkSettings.Networks.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 15:18:44 +02:00
Austin Vazquez
1b4fcb8da7 api/types/network: move CreateOptions type to client module
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-27 08:10:20 -05:00
Austin Vazquez
1e249cc309 api/types/network: move connect/disconnect options types to client module
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-27 07:05:52 -05:00
Paweł Gronowski
ed8a6a89ca Merge pull request #50809 from thaJeztah/container_inspect_merge
api/types/container: merge InspectResponse and ContainerJSONBase
2025-08-27 12:26:19 +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
Sebastiaan van Stijn
fae54e03af api/types/container: merge InspectResponse and ContainerJSONBase
Merge the two types instead of embedding the ContainerJSONBase.
This should have no impact on the API response, but users constructing
a response through struct literals will need to update their code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-26 20:18:57 +02:00
Sebastiaan van Stijn
7145e7666b Merge pull request #50794 from austinvazquez/move-swarm-option-types-to-client
api/types/swarm: move swarm option types to client
2025-08-26 18:44:02 +02: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