vendor: github.com/moby/moby/api, moby/moby/client master

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-10-17 03:04:46 +02:00
parent 171a9b70b2
commit 563f5fe335
36 changed files with 261 additions and 208 deletions

View File

@ -19,12 +19,12 @@ type fakeClient struct {
version string
containerListFunc func(context.Context, client.ContainerListOptions) ([]container.Summary, error)
containerPruneFunc func(ctx context.Context, pruneFilters client.Filters) (container.PruneReport, error)
containerPruneFunc func(ctx context.Context, options client.ContainerPruneOptions) (client.ContainerPruneResult, error)
eventsFn func(context.Context, client.EventsListOptions) (<-chan events.Message, <-chan error)
imageListFunc func(ctx context.Context, options client.ImageListOptions) ([]image.Summary, error)
infoFunc func(ctx context.Context) (system.Info, error)
networkListFunc func(ctx context.Context, options client.NetworkListOptions) ([]network.Summary, error)
networkPruneFunc func(ctx context.Context, pruneFilter client.Filters) (network.PruneReport, error)
networkPruneFunc func(ctx context.Context, options client.NetworkPruneOptions) (client.NetworkPruneResult, error)
nodeListFunc func(ctx context.Context, options client.NodeListOptions) ([]swarm.Node, error)
serverVersion func(ctx context.Context) (types.Version, error)
volumeListFunc func(ctx context.Context, options client.VolumeListOptions) (volume.ListResponse, error)
@ -41,11 +41,11 @@ func (cli *fakeClient) ContainerList(ctx context.Context, options client.Contain
return []container.Summary{}, nil
}
func (cli *fakeClient) ContainersPrune(ctx context.Context, pruneFilters client.Filters) (container.PruneReport, error) {
func (cli *fakeClient) ContainersPrune(ctx context.Context, opts client.ContainerPruneOptions) (client.ContainerPruneResult, error) {
if cli.containerPruneFunc != nil {
return cli.containerPruneFunc(ctx, pruneFilters)
return cli.containerPruneFunc(ctx, opts)
}
return container.PruneReport{}, nil
return client.ContainerPruneResult{}, nil
}
func (cli *fakeClient) Events(ctx context.Context, opts client.EventsListOptions) (<-chan events.Message, <-chan error) {
@ -73,11 +73,11 @@ func (cli *fakeClient) NetworkList(ctx context.Context, options client.NetworkLi
return []network.Summary{}, nil
}
func (cli *fakeClient) NetworksPrune(ctx context.Context, pruneFilter client.Filters) (network.PruneReport, error) {
func (cli *fakeClient) NetworksPrune(ctx context.Context, opts client.NetworkPruneOptions) (client.NetworkPruneResult, error) {
if cli.networkPruneFunc != nil {
return cli.networkPruneFunc(ctx, pruneFilter)
return cli.networkPruneFunc(ctx, opts)
}
return network.PruneReport{}, nil
return client.NetworkPruneResult{}, nil
}
func (cli *fakeClient) NodeList(ctx context.Context, options client.NodeListOptions) ([]swarm.Node, error) {

View File

@ -239,7 +239,7 @@ func nodeNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []str
// pluginNames contacts the API to get a list of plugin names.
// In case of an error, an empty list is returned.
func pluginNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string {
list, err := dockerCLI.Client().PluginList(cmd.Context(), nil)
list, err := dockerCLI.Client().PluginList(cmd.Context(), client.PluginListOptions{})
if err != nil {
return []string{}
}

View File

@ -8,8 +8,6 @@ import (
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/internal/test"
"github.com/moby/moby/api/types/container"
"github.com/moby/moby/api/types/network"
"github.com/moby/moby/client"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
@ -56,11 +54,11 @@ func TestSystemPrunePromptTermination(t *testing.T) {
t.Cleanup(cancel)
cli := test.NewFakeCli(&fakeClient{
containerPruneFunc: func(ctx context.Context, pruneFilters client.Filters) (container.PruneReport, error) {
return container.PruneReport{}, errors.New("fakeClient containerPruneFunc should not be called")
containerPruneFunc: func(context.Context, client.ContainerPruneOptions) (client.ContainerPruneResult, error) {
return client.ContainerPruneResult{}, errors.New("fakeClient containerPruneFunc should not be called")
},
networkPruneFunc: func(ctx context.Context, pruneFilters client.Filters) (network.PruneReport, error) {
return network.PruneReport{}, errors.New("fakeClient networkPruneFunc should not be called")
networkPruneFunc: func(context.Context, client.NetworkPruneOptions) (client.NetworkPruneResult, error) {
return client.NetworkPruneResult{}, errors.New("fakeClient networkPruneFunc should not be called")
},
})