4561 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
cdede16ce7 Merge pull request #51399 from thaJeztah/swarm_enums
api/types/swarm: create types for enum-consts
2025-11-05 16:33:20 +01:00
Sebastiaan van Stijn
39ccd04ca8 api/types/swarm: define type for RegistryAuthSource
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 13:48:38 +01:00
Sebastiaan van Stijn
d299e5be83 api/types/swarm: define type for UpdateOrder
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 12:50:51 +01:00
Sebastiaan van Stijn
b552b8b729 api/types/swarm: define type for FailureAction
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 12:50:48 +01:00
Austin Vazquez
a69abdd90d api/types/system: add type specific usage fields to DiskUsage
This change adds type specific fields to `GET /system/df` endpoint with high level information of disk usage. This change also introduces `verbose` query to the endpoint so that detailed information is by default excluded unless queried to reduce memory consumption. The previous top level `DiskUsage` fields (`Images`, `Containers`, `Volumes` and `BuildCache`) are now deprecated and kept for backwards compatibility.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-11-03 16:34:26 -06:00
Sebastiaan van Stijn
12c9de37e9 api/types: move Version to api/types/system
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 02:09:38 +01:00
Sebastiaan van Stijn
ebe464ea45 api/types: remove PushResult type, and move internal
This type was used as Aux message for docker push, was not documented,
and only present for Docker Content Trust (which is deprecated).

This patch removes it from the API module, and moves the type internal.
We can stop sending this Aux message once DCT is fully phased out.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 00:47:23 +01:00
Cory Snider
19f4c27d81 api/t/network: represent MAC addrs as byte slices
Make invalid states unrepresentable by moving away from stringly-typed
MAC address values in API structs. As go.dev/issue/29678 has not yet
been implemented, provide our own HardwareAddr byte-slice type which
implements TextMarshaler and TextUnmarshaler to retain compatibility
with the API wire format.

When stdlib's net.HardwareAddr type implements TextMarshaler and
TextUnmarshaler and GODEBUG=netmarshal becomes the default, we should be
able to make the type a straight alias for stdlib net.HardwareAddr as a
non-breaking change.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-10-30 17:11:38 -04:00
Sebastiaan van Stijn
0eba2989e0 api/types/registry: rename AuthenticateOKBody to AuthResponse
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 18:06:29 +01:00
Austin Vazquez
bae45f766d api/types/network: define ConnectRequest and DisconnectRequest
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-29 11:44:18 +01:00
Sebastiaan van Stijn
9e7e01ef16 Merge pull request #51153 from corhere/excise-json-streams-from-api
api: move `pkg/streamformatter`, `pkg/progress` to `daemon/internal`
2025-10-28 13:36:16 +01:00
Sebastiaan van Stijn
6a2a1dd6cf api/types/container: StatsResponse: add OSType field
Adds a per-stats OSType field to allow handle the platform-specific fields.
Before this change, the client had to get the OSType field from the server's
API response header and copy it to each record.

Older daemon versions don't have this field, so the client still needs to
handle fallbacks.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-27 16:39:32 +01:00
Sebastiaan van Stijn
3088c4e192 api/types/container: StatsResponse: cleanup fields and GoDoc
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-26 20:37:40 +01:00
Cory Snider
687c3d7f42 api/types/jsonstream: define Message type
The schema of a JSON-stream message is very pertinent to the api module.
Provide a canonical definition in the api module and refactor the daemon
code to use it. Drop the long-deprecated ErrorMessage field from the API
definition, but have the daemon continue to emit it for compatibility
with docker-py v7.1.0.

Co-authored-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-24 07:56:58 -05:00
Cory Snider
ae28867804 api/pkg/progress: move to client and daemon/internal
Move the progress package up into the client as a temporary shared location for
common clients like CLI and compose.

The progress package is used by the daemon to write progress updates to
some sink, typically a streamformatter. This package is of little use to
API clients as this package does not provide any facilities to consume
the progress updates.

Co-authored-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-24 07:56:57 -05:00
Cory Snider
6baf274fa3 api/pkg/streamformatter: move to client and daemon/internal
Move the streamformatter package up into the client for a temporary
shared location between common clients like CLI and compose.

The streamformatter package is used by the daemon to write streams of
status and progress messages to API clients. It is completely out of
scope of the api module and not used outside the daemon. Remove the
unused rawSteamFormatter, whose purpose is to render the progress as a
TUI.

Co-authored-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-24 07:56:51 -05:00
Paweł Gronowski
ea59a8d74e Merge pull request #51114 from dperny/memory_flags_for_swarm
Add support for memory swap settings for services
2025-10-24 10:04:17 +02:00
Austin Vazquez
f40e1a7582 api: move types/versions to client/pkg and daemon/internal
This change moves the api/types/versions package out into client and daemon versions.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-23 19:22:31 -05:00
Paweł Gronowski
ee49bbabb3 Merge pull request #51261 from thaJeztah/fix_api_godoc
api/types: fix godoc
2025-10-22 13:35:09 +02:00
Sebastiaan van Stijn
f09ca78b45 api/types: fix godoc
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-22 12:09:04 +02:00
Sebastiaan van Stijn
8dc5d1e64d api/types: move Ping and swarm.Status to client
The API does not produce these as a response; the fields in the Ping
struct, including the Swarm status are propagated from headers returned
by the /_ping endpoint.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-22 11:05:08 +02:00
Sebastiaan van Stijn
a8950e0192 api/types/container: remove deprecated Config.MacAddress
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 09:15:26 +02:00
Austin Vazquez
42ba5466c7 api: rename volumes.CreateOptions to volumes.CreateRequest
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-20 13:23:41 -05:00
Jean Rouge
3a90dd8b8f Adding support for memory swap settings for services
With integration tests

Relevant Swarmkit PR: https://github.com/docker/swarmkit/pull/2816
(updated the vendored version of Swarkit to that)

Signed-off-by: Jean Rouge <rougej+github@gmail.com>

Updated for latest master, fixed bitrot.

Signed-off-by: Drew Erny <derny@mirantis.com>
2025-10-20 10:34:05 -05:00
Sebastiaan van Stijn
5061d0a74d api/types/swarm: remove deprecated ServiceSpec.Networks field
This field was deprecated in [engine-api@5c4b684], which got vendored into
Moby in [moby@8f7a8c7] (API v1.25), and wired up in [moby@99a98cc].

[engine-api@5c4b684]: 5c4b684b2f
[moby@8f7a8c7]: 8f7a8c75ae
[moby@99a98cc]: 99a98ccc14

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-17 22:20:00 +02:00
Austin Vazquez
aa36c44ef9 api/types/volume: move UpdateOptions to client.VolumeUpdateOptions
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-16 16:07:28 -05:00
Sebastiaan van Stijn
44beb53e63 Merge pull request #51203 from thaJeztah/move_macaddress_operational
api/types/network: EndpointSettings: make MacAddress "operational data"
2025-10-16 23:01:46 +02:00
Sebastiaan van Stijn
9720ee037d Merge pull request #51190 from thaJeztah/remove_virtualsize
api/types/image: remove deprecated Summary.VirtualSize field
2025-10-16 21:43:19 +02:00
Sebastiaan van Stijn
9635f04e91 Merge pull request #51196 from austinvazquez/remove-image-inspect-parent-from-swagger
api: remove image inspect `Parent`, `DockerVersion` from swagger docs
2025-10-16 21:38:31 +02:00
Sebastiaan van Stijn
709336a2c3 api/types/network: EndpointSettings: make MacAddress "operational data"
The MacAddress field currently reflects _either_ the user-specified
(DesiredMacAddress) _or_ the actual / assigned MacAddress (when running).

Internal structs already have a separate DesiredMacAddres field, but
this field is not (yet) reflected in the API response. The intent is
to move towards better separation of config ("desired state") and
operational ("actual state") data.

Let's move the MacAddress field under "operational" data; the field's
description still describes its dual-personality, but potentially we
can move towards separate fields in future.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-16 20:43:39 +02:00
Sebastiaan van Stijn
40715adc99 Merge pull request #51189 from austinvazquez/stop-support-for-container-config-mac-address
api/types/container: remove support for config mac address
2025-10-15 20:53:26 +02:00
Austin Vazquez
3b075a79b9 api: remove image inspect Parent, DockerVersion from swagger docs
Follow-up to f8d3c4e4a7,
this change removes the `Parent` and `DockerVersion` fields from the swagger documentation.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-15 09:56:43 -05:00
Sebastiaan van Stijn
adb4269928 api/types/image: remove deprecated Summary.VirtualSize field
The `VirtualSize` field became redundant with the introduction of content-
addressable images in docker v1.10 (4352da7803),
after which the field was identical to the `Size` field. The field was marked
to be deprecated, which happened in 1261fe69a3
(API v1.43) and removed in API v1.44 (913b0f51ca).

Now that we stop supporting API versions older than v1.44, we can drop this
field; it's a minor breakage of old API versions, but the same information
is available in the "Size" field.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-15 01:49:57 +02:00
Austin Vazquez
2537eae6f3 api/types/container: remove support for config mac address
This change stops daemon support for the container config MacAddress field.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-14 17:42:02 -05:00
Sebastiaan van Stijn
47fe719b33 api/types/build: remove deprecated BuildCache.Parent field
The BuildCache.Parent field was removed in API v1.42 in [moby@e0db820].
While we had to keep the Go struct field around to backfill the field for
older API versions, it's no longer part of API v1.42 and up (using the
"omitempty" is just an implementation detail).

Older clients unconditionally use the `Parents` field if set, and usage
of this field is very limited, so let's remove the field without back-
filling, and have clients use the replacement field;
https://github.com/docker/cli/blob/v28.5.1/cli/command/formatter/buildcache.go

[moby@e0db820]: e0db8207f3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-14 14:51:31 +02:00
Sebastiaan van Stijn
9c39c3e158 Merge pull request #51179 from thaJeztah/fix_buildcache_parent_docs
api/docs: remove BuildCache.Parent field for API v1.42 and up
2025-10-14 14:16:48 +02:00
Sebastiaan van Stijn
45caa74e3b api/types/sytem: remove deprecated DiskUsage.BuilderSize
The `DiskUsage.BuilderSize` field was added as part of the, then experimental,
BuildKit builder in [moby@5c3d2d5] (API v1.31). It was deprecated in API v1.32
(through [moby@b225258]) but that change still returned the field. Commit
[moby@31348af] removed it in API v1.42. This field was never documented,
and part of an experimental feature, so we can remove it altogether.

[moby@5c3d2d5]: 5c3d2d552b
[moby@b225258]: b225258496
[moby@31348af]: 31348afa19

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-14 11:42:28 +02:00
Sebastiaan van Stijn
a5d9619093 api/docs: remove BuildCache.Parent field for API v1.42 and up
The BuildCache.Parent field was removed in API v1.42 in [moby@e0db820].
While we had to keep the Go struct field around to backfil the field for
older API versions, it's no longer part of API v1.42 and up (using the
"omitempty" is just an implementation detail).

This patch corrects the swagger files to match this.

[moby@e0db820]: e0db8207f3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-14 11:19:46 +02:00
Sebastiaan van Stijn
39cf847787 api: regenerate with go-swagger v0.33.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-11 19:59:25 +02:00
Sebastiaan van Stijn
bbdd24d145 api/templates: align with go-swagger v1.32.3
Align our custom templates with the one from upstream;
https://github.com/go-swagger/go-swagger/tree/v0.32.3/generator/templates

- Add "TODO" comments in places where we applied patches to make it
  easier to compare with upstream, and to see where differences are
  intentional.
- Update the server/operations.gotmpl template;
  - Add the "generated" header in the right place, so that it's
    recognized as generated file.
  - Add back the upstream template code; instead of removing the
    code, put a "if false" block around it; this allows comparing
    our forked templates with upstream when updating the version
    of go-swagger (to make sure we're not missing fixes).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-11 12:23:10 +02:00
Sebastiaan van Stijn
4d3da4f2ec Merge pull request #51154 from austinvazquez/add-omits-for-container-config-onbuild
api/types/container: omit `Config.OnBuild` when empty
2025-10-10 19:54:23 +02:00
Sebastiaan van Stijn
0769fe7087 Merge pull request #51157 from corhere/split-stdcopy
api/pkg/stdcopy: move stdWriter to daemon/internal
2025-10-10 17:33:43 +02:00
Austin Vazquez
ac3960a44c api/types/container: omit Config.OnBuild when empty
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-10 08:25:27 -05:00
Cory Snider
4c6e571d38 api/pkg/stdcopy: move stdWriter to daemon/internal
Clients have no need for muxing streams using our StdCopy wire format.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-10-09 20:13:26 -04:00
Austin Vazquez
8cf0529a8c api/types/swarm: add documentation to clarify virtual IP address type
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-09 18:02:43 -05:00
Austin Vazquez
c2812dc285 api: fix swarm network field from addr to prefix
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-09 12:02:57 -05:00
Cory Snider
7ea066c8d1 client: add Filters type
Add a new type to use for building filter predicates for API requests,
replacing "./api/types/filters".Args in the client. Remove the now
unused api/types/filters package.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-10-08 12:06:31 -04:00
Cory Snider
778e5bfad3 api/types/filters: move to daemon/internal
Most of the code in the filters package relates to the unmarshaling,
validation and application of filters from client requests. None of this
is necessary or particularly useful for Go SDK users. Move the full-fat
filters package into daemon/internal and switch all the daemon code to
import that package so we are free to iterate upon the code without
worrying about source-code interface compatibility.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-10-08 12:06:26 -04:00
Sebastiaan van Stijn
77ca284d28 Merge pull request #51103 from thaJeztah/image_inspect_rm_deprecated
api/types/image: InspectResponse: remove deprecated fields
2025-10-08 13:06:09 +02:00
Sebastiaan van Stijn
b1e20b6a3a api/types/system: remove deprecated Commit.Expected field
This field was deprecated API v1.48 in [moby@ff191c5], and removed in
API v1.49 in [moby@564abf9].

This patch:

- Removes the field from the API Go types.
- Reimplements the `/info` endpoint with the `compat` package to replace
  the local `infoResponse` implementation.
- Removes the `ServiceConfig.ExtraFields` field in api/types/registry
  introduced in [moby@7d9c50d] to backfill the `AllowNondistributableArtifactsCIDRs`
  and `AllowNondistributableArtifactsHostnames` fields for API < v1.47.

We should also consider deprecating the `ContainerdCommit`, `RuncCommit`
and `InitCommit` fields on the `/info` response (as we also include this
information as part of the components returned in `/version`), but those
can still be useful currently for situations where a user only provides
`docker info` output.

[moby@ff191c5]: ff191c58f7
[moby@564abf9]: 564abf9157
[moby@7d9c50d]: 7d9c50db2b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-07 18:18:55 +02:00