365 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
f2f622ebf4 internal/testutil/daemon: fix minor linting issues
- rename vars that shadowed
- suppress some unhandled errors

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-06 21:46:28 +01:00
Sebastiaan van Stijn
7239c72eca remove uses of deprecated go-archive consts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-19 17:51:03 +01:00
Paweł Gronowski
bce14ac5bc reflect: Use TypeFor instead of TypeOf
Added in Go 1.22

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:56:34 +01:00
Paweł Gronowski
3df05205f4 modernize: Use range int
Added in Go 1.22

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:56:34 +01:00
Paweł Gronowski
cdce8f4f92 modernize: Use maps.Copy instead of for loops
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:56:33 +01:00
Paweł Gronowski
c9b0a21bb1 modernize: Use b.Loop (introduced in Go 1.24)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:56:33 +01:00
Angad Bhalla
bb713e7fa8 Fix spelling error in comments for names-generator.go
Corrected the spelling of 'Poincaré Prize' in comments.

Signed-off-by: Angad Bhalla <74541474+Anga205@users.noreply.github.com>
2025-12-05 20:17:56 +05:30
Paweł Gronowski
217fd78905 Merge pull request #51412 from austinvazquez/use-regular-slice-for-disk-usage
api/types: use regular slices for disk usage types
2025-11-06 23:13:47 +01:00
Sebastiaan van Stijn
ff019cd853 internal/sliceutil: add Deref utility
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 12:15:25 +01:00
Sebastiaan van Stijn
f76f1fc013 client: Client.ImageSave: close reader on context cancellation
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 00:10:59 +01:00
Sebastiaan van Stijn
849239cedf client: Client.ImageLoad: close reader on context cancellation
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 00:07:14 +01:00
Sebastiaan van Stijn
466f2d2e5d Merge pull request #51354 from vvoland/bye-namegen
Move namesgenerator to internal
2025-10-31 00:25:03 +01:00
Paweł Gronowski
433023a03d Move namesgenerator to internal
It's frozen and only kept for historical/legacy purposes.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-30 19:41:58 +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
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
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
fc97a2ff0d client: Rename ContainerUnPause* to ContainerUnpause*
To better match the method name itself

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-29 11:32:32 +01:00
Austin Vazquez
e46058cbae client: refactor Events, Info, RegistryLogin
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-29 09:36:23 +01:00
Austin Vazquez
c5ddef1122 client: refactor ContainerList to wrap result
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-28 18:52:52 -05:00
Sebastiaan van Stijn
faee204c02 client: VolumeRemove: add output struct
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-28 15:42:33 +01:00
Sebastiaan van Stijn
1f5c82b9fa client: add option and output structs for various container methods
Add option- and output structs for;

- Client.ContainerKill
- Client.ContainerPause
- Client.ContainerRemove
- Client.ContainerResize
- Client.ContainerRestart
- Client.ContainerStart
- Client.ContainerStop
- Client.ContainerUnpause

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-27 23:46:28 +01:00
Sebastiaan van Stijn
425975313a client: merge ContainerInspectWithRaw with ContainerInspect
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-24 22:01:23 +02:00
Sebastiaan van Stijn
0b7b7625c6 client: rename NodeUpdateOptions.Node to NodeUpdateOptions.Spec
Align with the other swarm-types, which use `Spec` for updates.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-24 15:05:35 +02:00
Sebastiaan van Stijn
c6a45784f9 client: VolumeListResult: define local type
The `VolumeListResult.Items` field was a `volume.ListResponse`, which
in itself also had two slices (for volumes, and warnings). The Volumes
field contained a slice of pointers to Volumes.

This patch:

- Re-defines `ImageRemoveResult` as a distinct type, containing the
  content of the `volume.ListResponse.Volumes` and `.Warnings`.
- The `VolumeListResult` doesn't use a pointer for the volumes to make
  it slightly easier to deal with (possibly the API type could be
  changed as well, which could allow us to simplify the client code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-24 15:05:30 +02:00
Paweł Gronowski
3340c86db9 client/container_create: Rename ContainerName to Name
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-23 21:11:30 +02:00
Paweł Gronowski
bd31b8b1c7 client_(attach,commit,create,diff): Wrap result and options
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-23 21:11:30 +02:00
Sebastiaan van Stijn
3a43b5b559 client: refactor ServiceCreate, ServiceUpdate, SwarmUpdate
Put the version and spec in the options-struct, as we did for other
swarm-related methods.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-23 15:40:18 +02:00
Austin Vazquez
5a5d39205c client: rename ServiceListResult.Services to ServiceListResult.Items
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-22 15:55:03 -05:00
Austin Vazquez
909e32b27d client: refactor plugin api client functions to define options/results structs
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-22 13:45:03 +02:00
Paweł Gronowski
7ceea4148a client/node: Wrap options and output
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-22 12:02:05 +02:00
Sebastiaan van Stijn
25c509b026 Merge pull request #51251 from thaJeztah/secret_refactor
client/secrets: Wrap results and options
2025-10-22 11:50:01 +02:00
Austin Vazquez
9821df9b8e Merge pull request #51227 from vvoland/client-image-opts
client/image: Wrap result and options in structs
2025-10-21 20:42:14 -05:00
Austin Vazquez
a1cb9fe444 Merge pull request #51252 from austinvazquez/refactor-client-service
client: refactor service api client functions for defined options/res…
2025-10-21 20:25:13 -05:00
Paweł Gronowski
6819a9fc1e client/image_tag: Wrap options and result
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-21 19:38:12 -05:00
Paweł Gronowski
b3974f07f5 client/image_list: Wrap options and result
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-21 19:37:12 -05:00
Austin Vazquez
136c3b85e2 Merge pull request #51253 from thaJeztah/rm_config_utils
internal/testutil/daemon: remove "Config" utilities
2025-10-21 19:26:35 -05:00
Austin Vazquez
cd08b79c02 client: refactor service api client functions for defined options/result structs
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-21 19:18:07 -05:00
Austin Vazquez
13374b5a72 Merge pull request #51254 from thaJeztah/refactor_plugin_inspect
client: PluginInspectWithRaw: refactor and rename to PluginInspect
2025-10-21 17:48:02 -05:00
Sebastiaan van Stijn
8f50d38231 client: SwarmInspect: add options struct
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 23:30:21 +02:00
Sebastiaan van Stijn
95fac07ccc client/secrets: Wrap results and options
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 23:18:39 +02:00
Sebastiaan van Stijn
ebc92e015a client: PluginInspectWithRaw: refactor and rename to PluginInspect
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 23:14:08 +02:00
Sebastiaan van Stijn
8cd377bd9c internal/testutil/daemon: remove "Config" utilities
These were just shallow wrappers around the api-client, and some
were not used; inline them to help transition these tests to the
integration-suite in future.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 22:40:47 +02:00
Sebastiaan van Stijn
2c5e0a008a client: rename ConfigListResult.Configs to ConfigListResult.Items
Also consolidate the options with the method.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 20:43:38 +02:00
Sebastiaan van Stijn
c18c432852 Merge pull request #51246 from thaJeztah/volume_list
client: rename VolumeListResult.List to VolumeListResult.Items
2025-10-21 19:19:23 +02:00
Sebastiaan van Stijn
26d57f42a8 Merge pull request #51245 from thaJeztah/network_opts
client: NetworkInspect, NetworkList: wrap output structs, and remove NetworkInspectWithRaw
2025-10-21 18:50:33 +02:00
Austin Vazquez
e30e80de0a Merge pull request #51244 from austinvazquez/refactor-client-swarm
client: refactor swarm api functions to wrap params/responses
2025-10-21 11:35:56 -05:00
Sebastiaan van Stijn
5a04a9718d client: rename VolumeListResult.List to VolumeListResult.Items
Trying to find a common naming for these fields.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 18:07:50 +02:00
Sebastiaan van Stijn
485b95600a client: NetworkList: wrap result
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 17:40:19 +02:00
Austin Vazquez
612342198c client: refactor swarm api functions to wrap params/responses
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-21 10:17:04 -05:00