3227 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
7dc9d39ca1 client: make ContainerLogsResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:21:07 +01:00
Sebastiaan van Stijn
8d0b09c722 client: make ServiceLogsResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:08:54 +01:00
Sebastiaan van Stijn
0257c642c7 client: make ContainerExportResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:01:42 +01:00
Sebastiaan van Stijn
5bfc628e97 client: make ImageImportResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:01:42 +01:00
Sebastiaan van Stijn
5fc866fbfd client: make ImageLoadResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 16:28:35 +01:00
Sebastiaan van Stijn
1051c7f89e client: Client.ImageLoad: move description of platform parameter
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 16:28:35 +01:00
Sebastiaan van Stijn
b30eb86b31 go.mod: add back replace rules
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 16:08:47 +01:00
Sebastiaan van Stijn
5ac561ff8c Merge pull request #51373 from thaJeztah/no_exclude
go.mod: remove "exclude" rules
2025-10-31 19:32:08 +01:00
Sebastiaan van Stijn
5369540dd2 go.mod: remove "exclude" rules
These unfortunately prevent "go install github.com/moby/moby/v2/cmd/dockerd@XXX"
from working. Let's see if that works if we remove these. We may want to
add them back for the GA release of v29, but OTOH, nobody should have the
v2 module as dependency, so maybe it's not the end of the world.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 19:20:52 +01:00
Paweł Gronowski
3d772829ba vendor: github.com/moby/moby/client v0.1.0-beta.3
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-31 19:14:15 +01:00
Paweł Gronowski
93c273dc11 vendor: github.com/moby/moby/api v1.52.0-beta.4
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-31 18:57:59 +01:00
Paweł Gronowski
56bd456694 Drop replace rules
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-31 18:41:46 +01:00
Paweł Gronowski
76ba3b6a4b Merge pull request #51366 from vvoland/client-removeimagecreate
client: Remove ImageCreate in favor of ImagePull/ImageImport
2025-10-31 16:36:38 +01:00
Paweł Gronowski
73455ce01a client: Remove ImageCreate in favor of ImagePull/ImageImport
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-31 14:48:54 +01:00
Austin Vazquez
a087d03e0c client: refactor create network api implementation to wrap options/results
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-30 23:45:18 -05: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
f6ee11fe60 Merge pull request #51357 from thaJeztah/internalize_pushresult
api/types: remove PushResult type, and move internal
2025-10-31 02:02:06 +01:00
Sebastiaan van Stijn
3d28cb8bbd client: ServerVersionResult: add back legacy fields
Short term solution; we need to decide whether these should be kept
or removed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 01:21:10 +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
Rob Murray
43b48f1929 Merge pull request #51355 from corhere/api-macaddr-marshaltext
api/t/network: represent MAC addrs as byte slices
2025-10-30 23:43:12 +00:00
Sebastiaan van Stijn
97a1d44f05 Merge pull request #51342 from thaJeztah/client_platforms
client: prepare option-structs for multiple platforms
2025-10-30 22:18:58 +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
Paweł Gronowski
5a871b8299 Merge pull request #51156 from corhere/client-pkg-jsonmessage
client/pkg/jsonmessage: refactor in terms of `api/types/jsonstream`
2025-10-30 19:33:21 +01:00
Sebastiaan van Stijn
d1f70d4f54 client: deprecate NewClientWithOpts in favor of New
Use a more idiomatic name so that it can be used as `client.New()`.

We should look if we want `New()` to have different / updated defaults
i.e., enable `WithEnv` as default, and have an opt-out and have API-
version negotiation enabled by default (with an opt-out option).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 18:09:44 +01:00
Sebastiaan van Stijn
137adde33d client: prepare option-structs for multiple platforms
Some methods currently support a single platform only, but we may
be able to support multiple platforms.

This patch prepares the option-structs for multi-platform support,
but (for now) returning an error if multiple options are provided.

We need a similar check on the daemon-side, but still need to check
on the client, as older daemons will ignore multiple platforms, which
may be unexpected.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 18:04:34 +01:00
Austin Vazquez
860307c4ea client: refactor ServerVersion to return ServerVersionResult
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 14:22:41 +01:00
Paweł Gronowski
7a97e1cb40 Merge pull request #51334 from thaJeztah/rename_auth
api/types/registry: rename AuthenticateOKBody to AuthResponse
2025-10-29 23:51:39 +01:00
Sebastiaan van Stijn
af40d2bfed vendor: cloud.google.com/go/logging v1.12.0
not the latest version, but v1.13.x also includes an update for OTEL.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 23:04:20 +01:00
Sebastiaan van Stijn
15a1256f21 vendor: genproto v0.0.0-20240903143218-8af14fe29dc1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 23:02:29 +01:00
Sebastiaan van Stijn
88cbd467f6 vendor: cloud.google.com/go/compute/metadata v0.7.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 22:49:04 +01:00
Sebastiaan van Stijn
a5c0f152a7 daemon: improve validation for container rename
Improve validation for empty name; while the daemon already handled empty
strings, it didn't account for the "canonical" name with "/" prefix, for
which it would produce an obscure error:

    Error response from daemon: Error when allocating new name: Invalid container name (/ ), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed

Before this change:

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.51/containers/old/rename?name='
    {"message":"Neither old nor new names may be empty"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.51/containers/old/rename?name=/'
    {"message":"Error when allocating new name: Invalid container name (/), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.51/containers/old/rename?name=/hello'
    # OK

A check was added in the client as well for situations where an older daemon
is used; the same code currently was implemented in the CLI.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 18:42:36 +01:00
Sebastiaan van Stijn
7a8d8733c0 Merge pull request #51330 from thaJeztah/fix_client_example
client: fix example, and add runnable example
2025-10-29 18:17:34 +01: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
6cf02b5cba client: remove unused import
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-29 11:21:52 -05:00
Austin Vazquez
c5e318dbde Merge pull request #51328 from vvoland/client-containercopy-structs
client/container_copy: Wrap options and result struct
2025-10-29 10:44:59 -05:00
Sebastiaan van Stijn
b910408187 Merge pull request #51326 from vvoland/client-containerupdate-structs
client/container_update: Wrap options and result
2025-10-29 15:17:28 +01:00
Sebastiaan van Stijn
3c62b06de2 client: fix example, and add runnable example
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 15:16:58 +01:00
Paweł Gronowski
1cc2ab16ce client/container_copy: Wrap options and result struct
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-29 14:34:19 +01:00
Austin Vazquez
214cd508c0 Merge pull request #51327 from thaJeztah/unexport_NewVersionError
client: un-export NewVersionError, rename to requiresVersion
2025-10-29 08:08:41 -05:00
Austin Vazquez
a7a94c393d Merge pull request #51325 from thaJeztah/refactor_client_network_step1
client: refactor NetworkConnect, NetworkDisconnect, NetworkRemove
2025-10-29 08:06:32 -05:00
Sebastiaan van Stijn
e9631b507e Merge pull request #51323 from thaJeztah/container_wait_nits
client: ContainerWait: touch-up GoDoc, and remove legacy code, and use singular for channels (ContainerWaitResult)
2025-10-29 13:41:02 +01:00
Paweł Gronowski
38d703ff6f client/container_update: Wrap options and result
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-29 13:30:22 +01:00
Austin Vazquez
e9f28e2a41 client: refactor NetworkConnect, NetworkDisconnect, NetworkRemove
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 13:02:01 +01:00
Paweł Gronowski
c755b9635d Merge pull request #51322 from vvoland/client-fixup
client: Rename ContainerUnPause* to ContainerUnpause*
2025-10-29 12:56:32 +01:00
Paweł Gronowski
f708214dbf Merge pull request #51324 from thaJeztah/network_connect_disconnect
api/types/network: define `ConnectRequest` and `DisconnectRequest`
2025-10-29 12:56:15 +01:00
Sebastiaan van Stijn
2d6bf9332b client: un-export NewVersionError, rename to requiresVersion
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 12:44:41 +01:00
Sebastiaan van Stijn
29ad05b130 client: ContainerWaitResult: use singular for channels
These channels should ever only return a single result, so rename
them to match that expectation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 12:37:46 +01:00
Sebastiaan van Stijn
51a0584088 client: ContainerWait: touch-up GoDoc, remove legacy code
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 12:37:42 +01:00
Sebastiaan van Stijn
7041c02abd Merge pull request #51320 from thaJeztah/refactor_client_system_step1
client: refactor Events, Info, RegistryLogin
2025-10-29 12:25:28 +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