2297 Commits

Author SHA1 Message Date
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
749c980d4e client: refactor ContainerExport to wrap options/result structs
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-28 19:39:13 -05: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
Austin Vazquez
cf173bc941 client: refactor ContainerWait to use client defined options/results structs
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-28 18:15:01 -05:00
Austin Vazquez
4ce86e2c9b Merge pull request #51310 from thaJeztah/volume_output_structs
client: VolumeRemove, VolumeUpdate: add output struct
2025-10-28 18:14:24 -05:00
Austin Vazquez
aa380c26fc Merge pull request #51304 from thaJeztah/faulty_defers
fix some faulty defers in tests
2025-10-28 18:11:19 -05:00
Cory Snider
bbaeb9036f client/pkg/jsonmessage: use api message def'ns
Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-10-28 17:10:34 -04: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
8118385ba8 client: ContainerStats: add option, output-structs, remove ContainerStatsOneShot
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-27 14:03:55 +01:00
Sebastiaan van Stijn
155d697010 integration/container: TestStats: use sub-tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-27 12:43:47 +01:00
Sebastiaan van Stijn
6040a2f686 fix some faulty defers in tests
Calling "defer assert.NilError(t, someCommand())" executes "someCommand()"
immediately, but doesn't assert the error until the defer.
https://go.dev/play/p/EO--y7OYerg

    package main

    import (
        "errors"
        "testing"

        "gotest.tools/v3/assert"
    )

    func TestDefer(t *testing.T) {
        doSomething := func() error {
            t.Log("doSomething failed with an error!")
            return errors.New("foo error")
        }

        defer assert.NilError(t, doSomething())

        t.Log("running test")
        t.Log("running test")
        t.Log("running test")
    }

Produces:

    === RUN   TestDefer
        prog_test.go:12: doSomething failed with an error!
        prog_test.go:18: running test
        prog_test.go:19: running test
        prog_test.go:20: running test
        prog_test.go:21: assertion failed: error is not nil: foo error
    --- FAIL: TestDefer (0.00s)
    FAIL

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-27 12:39:21 +01:00
Paweł Gronowski
4aac139fc0 client/container_exec: Separate structs for Start and Attach
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-25 12:23:14 +02: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
12123eb592 client: merge ExecInspectResult with ExecInspect
The `ExecInspectResult` type was embedding `ExecInspect`, which is also
defined by the client, so there's no need to abstract it.

While updating, also;

- Rename `ExecID` to `ID`, to match the field-name returned by the API.
- Rename `Pid` to `PID`, to be in the right casing.
- Remove `json` labels, as option-types are not (un)marshaled to JSON.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-24 15:05:36 +02:00
Sebastiaan van Stijn
832590155c client: ExecCreateResult: define local type with ID field
The `ExecCreateResult` was embedding the `container.ExecCreateRespons`,
which in itself was an alias for `common.IDResponse`. This type has a
single field (`ID`) currently, but the embedding made it awkward to use,
for example, when mocking a `ExecCreateResult` using struct-literals:

    func execCreateWithID(_ string, _ client.ExecCreateOptions) (client.ExecCreateResult, error) {
        return client.ExecCreateResult{ExecCreateResponse: container.ExecCreateResponse{ID: "execid"}}, nil
    }

This patch defines it as a local type with the `ID` as field.

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
Sebastiaan van Stijn
c246639baa client: rename ImageRemoveResult.Deleted to ImageRemoveResult.Items
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-24 14:07:10 +02:00
Sebastiaan van Stijn
fb85d123c1 integration/service: fix tests for updated client
These tests were added in ea59a8d74e, but it
was merged out of order, not yet picking up changes made in the client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-24 13:51:47 +02:00
Sebastiaan van Stijn
f9082484c9 Merge pull request #51278 from vvoland/client-container-opts2
client_(attach,commit,create,diff): Wrap result and options
2025-10-24 13:41:23 +02: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
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
Sebastiaan van Stijn
11809618f6 Merge pull request #51270 from robmry/inspect-api-bc
Inspect: API v1.51 compatibility
2025-10-23 14:59:11 +02:00
Rob Murray
0971a3bcb8 Inspect: API v1.51 compatibility
For API < v1.52:
- In container inspect:
  - Restore GraphDriver when a snapshotter is used.
  - Remove field Storage
  - Related to commit efa077848f
- In image inspect:
  - Restore GraphDriver when a snapshotter is used.
  - Related to commit c441b2ef19

Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-10-23 09:24:08 +01:00
Albin Kerouanton
37ac6cec6c Merge pull request #50114 from danegsta/50107-defaultpoolsize
Proposal: Allow specifying the subnet size for networks allocated from default pools
2025-10-23 08:53:38 +02:00
Sebastiaan van Stijn
0049df8315 Merge pull request #51273 from austinvazquez/refactor-client-service-list
client: rename `ServiceListResult.Services` to `ServiceListResult.Items`
2025-10-23 00:19:30 +02:00
Sebastiaan van Stijn
f2412e7ab4 Merge pull request #51262 from vvoland/client-containerexec-opts
client/container_exec: Wrap options and result
2025-10-22 23:08:50 +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
Paweł Gronowski
94ab385eb5 client/container_exec: Wrap options and result, rename to Exec
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-22 22:48:59 +02:00
David Negstad
ea0d934ff2 Allow requesting networks with a custom prefix size from the default pools
Signed-off-by: David Negstad <David.Negstad@microsoft.com>
2025-10-22 12:45:55 -07: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
eddf1a1ad6 Merge pull request #51260 from vvoland/client-node-opts
client/node: Wrap options and output
2025-10-22 13:09:21 +02:00
Sebastiaan van Stijn
78d228b84e Merge pull request #51258 from thaJeztah/client_ping
api/types: move Ping and swarm.Status to client
2025-10-22 12:47:42 +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
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
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
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
347693a580 client/image_remove&search: Wrap options and result
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-21 19:37:18 -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
Paweł Gronowski
a7f409014f client/image_create&import: Wrap options and result
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-21 19:27:46 -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
e3c6dc2a91 client: VolumeInspect: add options struct
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 23:36:20 +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
Austin Vazquez
2401bd1e12 Merge pull request #51250 from thaJeztah/less_log
integration/network: TestServiceWithDefaultAddressPoolInit fix log
2025-10-21 15:15:48 -05:00