Skip to content

Commit

Permalink
[27.x] cli/command/system: adjust types for 27.x branch
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Nov 14, 2024
1 parent 4b61b37 commit 4430362
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cli/command/system/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type fakeClient struct {
client.Client

version string
containerListFunc func(context.Context, container.ListOptions) ([]container.Summary, error)
containerListFunc func(context.Context, container.ListOptions) ([]types.Container, error)
containerPruneFunc func(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error)
eventsFn func(context.Context, events.ListOptions) (<-chan events.Message, <-chan error)
imageListFunc func(ctx context.Context, options image.ListOptions) ([]image.Summary, error)
Expand All @@ -35,11 +35,11 @@ func (cli *fakeClient) ClientVersion() string {
return cli.version
}

func (cli *fakeClient) ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error) {
func (cli *fakeClient) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) {
if cli.containerListFunc != nil {
return cli.containerListFunc(ctx, options)
}
return []container.Summary{}, nil
return []types.Container{}, nil
}

func (cli *fakeClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error) {
Expand Down
6 changes: 3 additions & 3 deletions cli/command/system/completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func TestCompleteEventFilter(t *testing.T) {
}{
{
client: &fakeClient{
containerListFunc: func(_ context.Context, _ container.ListOptions) ([]container.Summary, error) {
return []container.Summary{
containerListFunc: func(_ context.Context, _ container.ListOptions) ([]types.Container, error) {
return []types.Container{
*builders.Container("c1"),
*builders.Container("c2"),
}, nil
Expand All @@ -39,7 +39,7 @@ func TestCompleteEventFilter(t *testing.T) {
},
{
client: &fakeClient{
containerListFunc: func(_ context.Context, _ container.ListOptions) ([]container.Summary, error) {
containerListFunc: func(_ context.Context, _ container.ListOptions) ([]types.Container, error) {
return nil, errors.New("API error")
},
},
Expand Down

0 comments on commit 4430362

Please sign in to comment.