Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump docker cli v1.25 beta1 #11247

Merged
merged 4 commits into from Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions go.mod
Expand Up @@ -12,9 +12,9 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/distribution/reference v0.5.0
github.com/docker/buildx v0.12.0
github.com/docker/cli v24.0.7+incompatible
github.com/docker/cli v25.0.0-beta.1+incompatible
github.com/docker/cli-docs-tool v0.6.0
github.com/docker/docker v24.0.7+incompatible
github.com/docker/docker v25.0.0-beta.1+incompatible
github.com/docker/go-connections v0.4.0
github.com/docker/go-units v0.5.0
github.com/fsnotify/fsevents v0.1.1
Expand Down Expand Up @@ -52,6 +52,7 @@ require (
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
Expand Down Expand Up @@ -118,10 +119,10 @@ require (
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/moby/sys/symlink v0.2.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/runc v1.1.9 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand Down Expand Up @@ -171,4 +172,5 @@ require (
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
tags.cncf.io/container-device-interface v0.6.2 // indirect
)
18 changes: 12 additions & 6 deletions go.sum
Expand Up @@ -35,6 +35,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
Expand Down Expand Up @@ -166,15 +168,15 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/buildx v0.12.0 h1:pI4jr4SeH9oHa0SmMvH/lz+Rdqkg+dRa9H/1VXbYgws=
github.com/docker/buildx v0.12.0/go.mod h1:SBLnQH9q+77aVvpvS5LLIly9+nHVlwscl5GEegGMD5g=
github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg=
github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v25.0.0-beta.1+incompatible h1:bJzIgR4mKNpceAwwi19SqZK0AbztMc3nQTgnvxxyY/A=
github.com/docker/cli v25.0.0-beta.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli-docs-tool v0.6.0 h1:Z9x10SaZgFaB6jHgz3OWooynhSa40CsWkpe5hEnG/qA=
github.com/docker/cli-docs-tool v0.6.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM=
github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.0-beta.1+incompatible h1:NiDFwGzVt+mR9Jb5oC4+cd8lE9Zs86TXhCQg0zGk/sk=
github.com/docker/docker v25.0.0-beta.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
Expand Down Expand Up @@ -436,6 +438,8 @@ github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI
github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg=
github.com/moby/sys/symlink v0.2.0 h1:tk1rOM+Ljp0nFmfOIBtlV3rTDlWOwFRhjEeAhZB0nZc=
github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs=
github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down Expand Up @@ -468,8 +472,8 @@ github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/
github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
github.com/opencontainers/runc v1.1.9 h1:XR0VIHTGce5eWPkaPesqTBrhW2yAcaraWfsEalNwQLM=
github.com/opencontainers/runc v1.1.9/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50=
github.com/opencontainers/runtime-spec v1.1.0-rc.2 h1:ucBtEms2tamYYW/SvGpvq9yUN0NEVL6oyLEwDcTSrk8=
github.com/opencontainers/runtime-spec v1.1.0-rc.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg=
github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
Expand Down Expand Up @@ -994,3 +998,5 @@ sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kF
sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
tags.cncf.io/container-device-interface v0.6.2 h1:dThE6dtp/93ZDGhqaED2Pu374SOeUkBfuvkLuiTdwzg=
tags.cncf.io/container-device-interface v0.6.2/go.mod h1:Shusyhjs1A5Na/kqPVLL0KqnHQHuunol9LFeUNkuGVE=
38 changes: 20 additions & 18 deletions pkg/api/dryrunclient.go
Expand Up @@ -34,13 +34,15 @@
"github.com/docker/buildx/util/imagetools"
"github.com/docker/cli/cli/command"
moby "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/checkpoint"
containerType "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/api/types/registry"
"github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/api/types/system"
"github.com/docker/docker/api/types/volume"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/jsonmessage"
Expand Down Expand Up @@ -94,7 +96,7 @@

// All methods and functions which need to be overridden for dry run.

func (d *DryRunClient) ContainerAttach(ctx context.Context, container string, options moby.ContainerAttachOptions) (moby.HijackedResponse, error) {
func (d *DryRunClient) ContainerAttach(ctx context.Context, container string, options containerType.AttachOptions) (moby.HijackedResponse, error) {

Check warning on line 99 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L99

Added line #L99 was not covered by tests
return moby.HijackedResponse{}, errors.New("interactive run is not supported in dry-run mode")
}

Expand Down Expand Up @@ -143,7 +145,7 @@
return nil
}

func (d *DryRunClient) ContainerList(ctx context.Context, options moby.ContainerListOptions) ([]moby.Container, error) {
func (d *DryRunClient) ContainerList(ctx context.Context, options containerType.ListOptions) ([]moby.Container, error) {

Check warning on line 148 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L148

Added line #L148 was not covered by tests
caller := getCallingFunction()
switch caller {
case "start":
Expand All @@ -162,7 +164,7 @@
return nil
}

func (d *DryRunClient) ContainerRemove(ctx context.Context, container string, options moby.ContainerRemoveOptions) error {
func (d *DryRunClient) ContainerRemove(ctx context.Context, container string, options containerType.RemoveOptions) error {

Check warning on line 167 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L167

Added line #L167 was not covered by tests
return nil
}

Expand All @@ -174,7 +176,7 @@
return nil
}

func (d *DryRunClient) ContainerStart(ctx context.Context, container string, options moby.ContainerStartOptions) error {
func (d *DryRunClient) ContainerStart(ctx context.Context, container string, options containerType.StartOptions) error {

Check warning on line 179 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L179

Added line #L179 was not covered by tests
return nil
}

Expand Down Expand Up @@ -259,7 +261,7 @@
return rc, nil
}

func (d *DryRunClient) ImageRemove(ctx context.Context, imageName string, options moby.ImageRemoveOptions) ([]moby.ImageDeleteResponseItem, error) {
func (d *DryRunClient) ImageRemove(ctx context.Context, imageName string, options moby.ImageRemoveOptions) ([]image.DeleteResponse, error) {

Check warning on line 264 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L264

Added line #L264 was not covered by tests
return nil, nil
}

Expand Down Expand Up @@ -341,7 +343,7 @@
return d.apiClient.ConfigUpdate(ctx, id, version, config)
}

func (d *DryRunClient) ContainerCommit(ctx context.Context, container string, options moby.ContainerCommitOptions) (moby.IDResponse, error) {
func (d *DryRunClient) ContainerCommit(ctx context.Context, container string, options containerType.CommitOptions) (moby.IDResponse, error) {

Check warning on line 346 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L346

Added line #L346 was not covered by tests
return d.apiClient.ContainerCommit(ctx, container, options)
}

Expand All @@ -357,7 +359,7 @@
return d.apiClient.ContainerExecInspect(ctx, execID)
}

func (d *DryRunClient) ContainerExecResize(ctx context.Context, execID string, options moby.ResizeOptions) error {
func (d *DryRunClient) ContainerExecResize(ctx context.Context, execID string, options containerType.ResizeOptions) error {

Check warning on line 362 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L362

Added line #L362 was not covered by tests
return d.apiClient.ContainerExecResize(ctx, execID, options)
}

Expand All @@ -369,11 +371,11 @@
return d.apiClient.ContainerInspectWithRaw(ctx, container, getSize)
}

func (d *DryRunClient) ContainerLogs(ctx context.Context, container string, options moby.ContainerLogsOptions) (io.ReadCloser, error) {
func (d *DryRunClient) ContainerLogs(ctx context.Context, container string, options containerType.LogsOptions) (io.ReadCloser, error) {

Check warning on line 374 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L374

Added line #L374 was not covered by tests
return d.apiClient.ContainerLogs(ctx, container, options)
}

func (d *DryRunClient) ContainerResize(ctx context.Context, container string, options moby.ResizeOptions) error {
func (d *DryRunClient) ContainerResize(ctx context.Context, container string, options containerType.ResizeOptions) error {

Check warning on line 378 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L378

Added line #L378 was not covered by tests
return d.apiClient.ContainerResize(ctx, container, options)
}

Expand Down Expand Up @@ -429,7 +431,7 @@
return d.apiClient.ImageImport(ctx, source, ref, options)
}

func (d *DryRunClient) ImageList(ctx context.Context, options moby.ImageListOptions) ([]moby.ImageSummary, error) {
func (d *DryRunClient) ImageList(ctx context.Context, options moby.ImageListOptions) ([]image.Summary, error) {

Check warning on line 434 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L434

Added line #L434 was not covered by tests
return d.apiClient.ImageList(ctx, options)
}

Expand Down Expand Up @@ -525,7 +527,7 @@
return d.apiClient.PluginCreate(ctx, createContext, options)
}

func (d *DryRunClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options moby.ServiceCreateOptions) (moby.ServiceCreateResponse, error) {
func (d *DryRunClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options moby.ServiceCreateOptions) (swarm.ServiceCreateResponse, error) {

Check warning on line 530 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L530

Added line #L530 was not covered by tests
return d.apiClient.ServiceCreate(ctx, service, options)
}

Expand All @@ -541,15 +543,15 @@
return d.apiClient.ServiceRemove(ctx, serviceID)
}

func (d *DryRunClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options moby.ServiceUpdateOptions) (moby.ServiceUpdateResponse, error) {
func (d *DryRunClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options moby.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error) {

Check warning on line 546 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L546

Added line #L546 was not covered by tests
return d.apiClient.ServiceUpdate(ctx, serviceID, version, service, options)
}

func (d *DryRunClient) ServiceLogs(ctx context.Context, serviceID string, options moby.ContainerLogsOptions) (io.ReadCloser, error) {
func (d *DryRunClient) ServiceLogs(ctx context.Context, serviceID string, options containerType.LogsOptions) (io.ReadCloser, error) {

Check warning on line 550 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L550

Added line #L550 was not covered by tests
return d.apiClient.ServiceLogs(ctx, serviceID, options)
}

func (d *DryRunClient) TaskLogs(ctx context.Context, taskID string, options moby.ContainerLogsOptions) (io.ReadCloser, error) {
func (d *DryRunClient) TaskLogs(ctx context.Context, taskID string, options containerType.LogsOptions) (io.ReadCloser, error) {

Check warning on line 554 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L554

Added line #L554 was not covered by tests
return d.apiClient.TaskLogs(ctx, taskID, options)
}

Expand Down Expand Up @@ -613,7 +615,7 @@
return d.apiClient.Events(ctx, options)
}

func (d *DryRunClient) Info(ctx context.Context) (moby.Info, error) {
func (d *DryRunClient) Info(ctx context.Context) (system.Info, error) {

Check warning on line 618 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L618

Added line #L618 was not covered by tests
return d.apiClient.Info(ctx)
}

Expand Down Expand Up @@ -685,14 +687,14 @@
return d.apiClient.Close()
}

func (d *DryRunClient) CheckpointCreate(ctx context.Context, container string, options moby.CheckpointCreateOptions) error {
func (d *DryRunClient) CheckpointCreate(ctx context.Context, container string, options checkpoint.CreateOptions) error {

Check warning on line 690 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L690

Added line #L690 was not covered by tests
return d.apiClient.CheckpointCreate(ctx, container, options)
}

func (d *DryRunClient) CheckpointDelete(ctx context.Context, container string, options moby.CheckpointDeleteOptions) error {
func (d *DryRunClient) CheckpointDelete(ctx context.Context, container string, options checkpoint.DeleteOptions) error {

Check warning on line 694 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L694

Added line #L694 was not covered by tests
return d.apiClient.CheckpointDelete(ctx, container, options)
}

func (d *DryRunClient) CheckpointList(ctx context.Context, container string, options moby.CheckpointListOptions) ([]moby.Checkpoint, error) {
func (d *DryRunClient) CheckpointList(ctx context.Context, container string, options checkpoint.ListOptions) ([]checkpoint.Summary, error) {

Check warning on line 698 in pkg/api/dryrunclient.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/dryrunclient.go#L698

Added line #L698 was not covered by tests
return d.apiClient.CheckpointList(ctx, container, options)
}
5 changes: 3 additions & 2 deletions pkg/compose/attach.go
Expand Up @@ -26,6 +26,7 @@
"github.com/compose-spec/compose-go/types"
"github.com/docker/cli/cli/streams"
moby "github.com/docker/docker/api/types"
containerType "github.com/docker/docker/api/types/container"
"github.com/docker/docker/pkg/stdcopy"
"github.com/moby/term"

Expand Down Expand Up @@ -157,7 +158,7 @@
func (s *composeService) getContainerStreams(ctx context.Context, container string) (io.WriteCloser, io.ReadCloser, error) {
var stdout io.ReadCloser
var stdin io.WriteCloser
cnx, err := s.apiClient().ContainerAttach(ctx, container, moby.ContainerAttachOptions{
cnx, err := s.apiClient().ContainerAttach(ctx, container, containerType.AttachOptions{
Stream: true,
Stdin: true,
Stdout: true,
Expand All @@ -171,7 +172,7 @@
}

// Fallback to logs API
logs, err := s.apiClient().ContainerLogs(ctx, container, moby.ContainerLogsOptions{
logs, err := s.apiClient().ContainerLogs(ctx, container, containerType.LogsOptions{

Check warning on line 175 in pkg/compose/attach.go

View check run for this annotation

Codecov / codecov/patch

pkg/compose/attach.go#L175

Added line #L175 was not covered by tests
ShowStdout: true,
ShowStderr: true,
Follow: true,
Expand Down
5 changes: 3 additions & 2 deletions pkg/compose/containers.go
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/docker/compose/v2/pkg/api"
"github.com/docker/compose/v2/pkg/utils"
moby "github.com/docker/docker/api/types"
containerType "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
)

Expand All @@ -43,7 +44,7 @@ const (
func (s *composeService) getContainers(ctx context.Context, project string, oneOff oneOff, stopped bool, selectedServices ...string) (Containers, error) {
var containers Containers
f := getDefaultFilters(project, oneOff, selectedServices...)
containers, err := s.apiClient().ContainerList(ctx, moby.ContainerListOptions{
containers, err := s.apiClient().ContainerList(ctx, containerType.ListOptions{
Filters: filters.NewArgs(f...),
All: stopped,
})
Expand Down Expand Up @@ -77,7 +78,7 @@ func (s *composeService) getSpecifiedContainer(ctx context.Context, projectName
if containerIndex > 0 {
defaultFilters = append(defaultFilters, containerNumberFilter(containerIndex))
}
containers, err := s.apiClient().ContainerList(ctx, moby.ContainerListOptions{
containers, err := s.apiClient().ContainerList(ctx, containerType.ListOptions{
Filters: filters.NewArgs(
defaultFilters...,
),
Expand Down
8 changes: 4 additions & 4 deletions pkg/compose/convergence.go
Expand Up @@ -141,7 +141,7 @@
if err != nil {
return err
}
return c.service.apiClient().ContainerRemove(ctx, container.ID, moby.ContainerRemoveOptions{})
return c.service.apiClient().ContainerRemove(ctx, container.ID, containerType.RemoveOptions{})
}))
continue
}
Expand Down Expand Up @@ -515,7 +515,7 @@
return created, err
}

err = s.apiClient().ContainerRemove(ctx, replaced.ID, moby.ContainerRemoveOptions{})
err = s.apiClient().ContainerRemove(ctx, replaced.ID, containerType.RemoveOptions{})
if err != nil {
return created, err
}
Expand Down Expand Up @@ -549,7 +549,7 @@
func (s *composeService) startContainer(ctx context.Context, container moby.Container) error {
w := progress.ContextWriter(ctx)
w.Event(progress.NewEvent(getContainerProgressName(container), progress.Working, "Restart"))
err := s.apiClient().ContainerStart(ctx, container.ID, moby.ContainerStartOptions{})
err := s.apiClient().ContainerStart(ctx, container.ID, containerType.StartOptions{})

Check warning on line 552 in pkg/compose/convergence.go

View check run for this annotation

Codecov / codecov/patch

pkg/compose/convergence.go#L552

Added line #L552 was not covered by tests
if err != nil {
return err
}
Expand Down Expand Up @@ -764,7 +764,7 @@
}
eventName := getContainerProgressName(container)
w.Event(progress.StartingEvent(eventName))
err := s.apiClient().ContainerStart(ctx, container.ID, moby.ContainerStartOptions{})
err := s.apiClient().ContainerStart(ctx, container.ID, containerType.StartOptions{})
if err != nil {
return err
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/compose/convergence_test.go
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/compose-spec/compose-go/types"
moby "github.com/docker/docker/api/types"
containerType "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/golang/mock/gomock"
"gotest.tools/v3/assert"
Expand Down Expand Up @@ -63,7 +64,7 @@ func TestServiceLinks(t *testing.T) {
Scale: 1,
}

containerListOptions := moby.ContainerListOptions{
containerListOptions := containerType.ListOptions{
Filters: filters.NewArgs(
projectFilter(testProject),
serviceFilter("db"),
Expand Down Expand Up @@ -189,7 +190,7 @@ func TestServiceLinks(t *testing.T) {
s.Labels = s.Labels.Add(api.OneoffLabel, "True")

c := testContainer("web", webContainerName, true)
containerListOptionsOneOff := moby.ContainerListOptions{
containerListOptionsOneOff := containerType.ListOptions{
Filters: filters.NewArgs(
projectFilter(testProject),
serviceFilter("web"),
Expand Down