Skip to content

Commit c75e494

Browse files
committed
go.mod: bump github.com/moby/moby/api v1.53.0, moby/client v0.2.2
Also update TestDefaultNetworkSettings: Test that the network with the highest priority is returned as "primary" network, and other networks as extra networks. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 7abaa06 commit c75e494

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2096
-2240
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ example-provider: ## build example provider for e2e tests
9595
mocks:
9696
mockgen --version >/dev/null 2>&1 || go install go.uber.org/mock/mockgen@v0.4.0
9797
mockgen -destination pkg/mocks/mock_docker_cli.go -package mocks github.com/docker/cli/cli/command Cli
98-
mockgen -destination pkg/mocks/mock_docker_api.go -package mocks github.com/docker/docker/client APIClient
98+
mockgen -destination pkg/mocks/mock_docker_api.go -package mocks github.com/moby/moby/client APIClient
9999
mockgen -destination pkg/mocks/mock_docker_compose_api.go -package mocks -source=./pkg/api/api.go Service
100100

101101
.PHONY: e2e

cmd/compose/bridge.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import (
2323

2424
"github.com/distribution/reference"
2525
"github.com/docker/cli/cli/command"
26-
"github.com/docker/docker/api/types/image"
27-
"github.com/docker/docker/pkg/stringid"
2826
"github.com/docker/go-units"
27+
"github.com/moby/moby/api/types/image"
28+
"github.com/moby/moby/client/pkg/stringid"
2929
"github.com/spf13/cobra"
3030

3131
"github.com/docker/compose/v5/cmd/formatter"

cmd/compose/compose.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
composepaths "github.com/compose-spec/compose-go/v2/paths"
3636
"github.com/compose-spec/compose-go/v2/types"
3737
composegoutils "github.com/compose-spec/compose-go/v2/utils"
38-
"github.com/docker/buildx/util/logutil"
3938
dockercli "github.com/docker/cli/cli"
4039
"github.com/docker/cli/cli-plugins/metadata"
4140
"github.com/docker/cli/cli/command"
@@ -423,16 +422,6 @@ func (o *BackendOptions) Add(option compose.Option) {
423422

424423
// RootCommand returns the compose command with its child commands
425424
func RootCommand(dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command { //nolint:gocyclo
426-
// filter out useless commandConn.CloseWrite warning message that can occur
427-
// when using a remote context that is unreachable: "commandConn.CloseWrite: commandconn: failed to wait: signal: killed"
428-
// https://github.com/docker/cli/blob/e1f24d3c93df6752d3c27c8d61d18260f141310c/cli/connhelper/commandconn/commandconn.go#L203-L215
429-
logrus.AddHook(logutil.NewFilter([]logrus.Level{
430-
logrus.WarnLevel,
431-
},
432-
"commandConn.CloseWrite:",
433-
"commandConn.CloseRead:",
434-
))
435-
436425
opts := ProjectOptions{}
437426
var (
438427
ansi string

cmd/compose/images.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import (
2727

2828
"github.com/containerd/platforms"
2929
"github.com/docker/cli/cli/command"
30-
"github.com/docker/docker/pkg/stringid"
3130
"github.com/docker/go-units"
31+
"github.com/moby/moby/client/pkg/stringid"
3232
"github.com/spf13/cobra"
3333

3434
"github.com/docker/compose/v5/cmd/formatter"

cmd/compose/list.go

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ package compose
1818

1919
import (
2020
"context"
21+
"errors"
2122
"fmt"
2223
"io"
24+
"regexp"
2325
"strings"
2426

2527
"github.com/docker/cli/cli/command"
2628
"github.com/docker/cli/opts"
29+
"github.com/moby/moby/client"
2730
"github.com/spf13/cobra"
2831

2932
"github.com/docker/compose/v5/cmd/formatter"
@@ -61,11 +64,32 @@ var acceptedListFilters = map[string]bool{
6164
"name": true,
6265
}
6366

67+
// match returns true if any of the values at key match the source string
68+
func match(filters client.Filters, field, source string) bool {
69+
if f, ok := filters[field]; ok && f[source] {
70+
return true
71+
}
72+
73+
fieldValues := filters[field]
74+
for name2match := range fieldValues {
75+
isMatch, err := regexp.MatchString(name2match, source)
76+
if err != nil {
77+
continue
78+
}
79+
if isMatch {
80+
return true
81+
}
82+
}
83+
return false
84+
}
85+
6486
func runList(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, lsOpts lsOptions) error {
6587
filters := lsOpts.Filter.Value()
66-
err := filters.Validate(acceptedListFilters)
67-
if err != nil {
68-
return err
88+
89+
for filter := range filters {
90+
if _, ok := acceptedListFilters[filter]; !ok {
91+
return errors.New("invalid filter '" + filter + "'")
92+
}
6993
}
7094

7195
backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...)
@@ -77,13 +101,12 @@ func runList(ctx context.Context, dockerCli command.Cli, backendOptions *Backend
77101
return err
78102
}
79103

80-
if filters.Len() > 0 {
104+
if len(filters) > 0 {
81105
var filtered []api.Stack
82106
for _, s := range stackList {
83-
if filters.Contains("name") && !filters.Match("name", s.Name) {
84-
continue
107+
if match(filters, "name", s.Name) {
108+
filtered = append(filtered, s)
85109
}
86-
filtered = append(filtered, s)
87110
}
88111
stackList = filtered
89112
}

cmd/compose/ps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func filterByStatus(containers []api.ContainerSummary, statuses []string) []api.
176176

177177
func hasStatus(c api.ContainerSummary, statuses []string) bool {
178178
for _, status := range statuses {
179-
if c.State == status {
179+
if string(c.State) == status {
180180
return true
181181
}
182182
}

cmd/compose/stats.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
"github.com/docker/cli/cli/command"
2424
"github.com/docker/cli/cli/command/container"
25-
"github.com/docker/docker/api/types/filters"
25+
"github.com/moby/moby/client"
2626
"github.com/spf13/cobra"
2727

2828
"github.com/docker/compose/v5/pkg/api"
@@ -67,18 +67,17 @@ func runStats(ctx context.Context, dockerCli command.Cli, opts statsOptions, ser
6767
if err != nil {
6868
return err
6969
}
70-
filter := []filters.KeyValuePair{
71-
filters.Arg("label", fmt.Sprintf("%s=%s", api.ProjectLabel, name)),
72-
}
70+
f := client.Filters{}
71+
f.Add("label", fmt.Sprintf("%s=%s", api.ProjectLabel, name))
72+
7373
if len(service) > 0 {
74-
filter = append(filter, filters.Arg("label", fmt.Sprintf("%s=%s", api.ServiceLabel, service[0])))
74+
f.Add("label", fmt.Sprintf("%s=%s", api.ServiceLabel, service[0]))
7575
}
76-
args := filters.NewArgs(filter...)
7776
return container.RunStats(ctx, dockerCli, &container.StatsOptions{
7877
All: opts.all,
7978
NoStream: opts.noStream,
8079
NoTrunc: opts.noTrunc,
8180
Format: opts.format,
82-
Filters: &args,
81+
Filters: f,
8382
})
8483
}

cmd/formatter/container.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ package formatter
1818

1919
import (
2020
"fmt"
21+
"net/netip"
2122
"strconv"
2223
"strings"
2324
"time"
2425

2526
"github.com/docker/cli/cli/command/formatter"
26-
"github.com/docker/docker/api/types/container"
27-
"github.com/docker/docker/pkg/stringid"
2827
"github.com/docker/go-units"
28+
"github.com/moby/moby/api/types/container"
29+
"github.com/moby/moby/client/pkg/stringid"
2930

3031
"github.com/docker/compose/v5/pkg/api"
3132
)
@@ -197,26 +198,32 @@ func (c *ContainerContext) ExitCode() int {
197198
}
198199

199200
func (c *ContainerContext) State() string {
200-
return c.c.State
201+
return string(c.c.State)
201202
}
202203

203204
func (c *ContainerContext) Status() string {
204205
return c.c.Status
205206
}
206207

207208
func (c *ContainerContext) Health() string {
208-
return c.c.Health
209+
return string(c.c.Health)
209210
}
210211

211212
func (c *ContainerContext) Publishers() api.PortPublishers {
212213
return c.c.Publishers
213214
}
214215

215216
func (c *ContainerContext) Ports() string {
216-
var ports []container.Port
217+
var ports []container.PortSummary
217218
for _, publisher := range c.c.Publishers {
218-
ports = append(ports, container.Port{
219-
IP: publisher.URL,
219+
var pIP netip.Addr
220+
if publisher.URL != "" {
221+
if p, err := netip.ParseAddr(publisher.URL); err == nil {
222+
pIP = p
223+
}
224+
}
225+
ports = append(ports, container.PortSummary{
226+
IP: pIP,
220227
PrivatePort: uint16(publisher.TargetPort),
221228
PublicPort: uint16(publisher.PublishedPort),
222229
Type: publisher.Protocol,

cmd/formatter/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"time"
2727

2828
"github.com/buger/goterm"
29-
"github.com/docker/docker/pkg/jsonmessage"
29+
"github.com/moby/moby/client/pkg/jsonmessage"
3030

3131
"github.com/docker/compose/v5/pkg/api"
3232
)

go.mod

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/docker/compose/v5
22

3-
go 1.24.3
3+
go 1.25.0
44

55
require (
66
github.com/AlecAivazis/survey/v2 v2.3.7
@@ -14,8 +14,8 @@ require (
1414
github.com/containerd/errdefs v1.0.0
1515
github.com/containerd/platforms v1.0.0-rc.2
1616
github.com/distribution/reference v0.6.0
17-
github.com/docker/buildx v0.30.1
18-
github.com/docker/cli v28.5.2+incompatible
17+
github.com/docker/buildx v0.31.1
18+
github.com/docker/cli v29.2.1+incompatible
1919
github.com/docker/cli-docs-tool v0.11.0
2020
github.com/docker/docker v28.5.2+incompatible
2121
github.com/docker/go-connections v0.6.0
@@ -29,8 +29,10 @@ require (
2929
github.com/jonboulle/clockwork v0.5.0
3030
github.com/mattn/go-shellwords v1.0.12
3131
github.com/mitchellh/go-ps v1.0.0
32-
github.com/moby/buildkit v0.26.3
33-
github.com/moby/go-archive v0.1.0
32+
github.com/moby/buildkit v0.27.1
33+
github.com/moby/go-archive v0.2.0
34+
github.com/moby/moby/api v1.53.0
35+
github.com/moby/moby/client v0.2.2
3436
github.com/moby/patternmatcher v0.6.0
3537
github.com/moby/sys/atomicwriter v0.1.0
3638
github.com/morikuni/aec v1.1.0
@@ -62,9 +64,7 @@ require (
6264

6365
require (
6466
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
65-
github.com/beorn7/perks v1.0.1 // indirect
6667
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
67-
github.com/cespare/xxhash/v2 v2.3.0 // indirect
6868
github.com/containerd/containerd/api v1.10.0 // indirect
6969
github.com/containerd/continuity v0.4.5 // indirect
7070
github.com/containerd/errdefs/pkg v0.3.0 // indirect
@@ -74,9 +74,7 @@ require (
7474
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
7575
github.com/davecgh/go-spew v1.1.1 // indirect
7676
github.com/docker/distribution v2.8.3+incompatible // indirect
77-
github.com/docker/docker-credential-helpers v0.9.3 // indirect
78-
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
79-
github.com/docker/go-metrics v0.0.1 // indirect
77+
github.com/docker/docker-credential-helpers v0.9.5 // indirect
8078
github.com/felixge/httpsnoop v1.0.4 // indirect
8179
github.com/fvbommel/sortorder v1.1.0 // indirect
8280
github.com/go-logr/logr v1.4.3 // indirect
@@ -87,22 +85,19 @@ require (
8785
github.com/golang/protobuf v1.5.4 // indirect
8886
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
8987
github.com/gorilla/mux v1.8.1 // indirect
90-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
88+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
9189
github.com/hashicorp/errwrap v1.1.0 // indirect
9290
github.com/hashicorp/go-multierror v1.1.1 // indirect
9391
github.com/in-toto/in-toto-golang v0.9.0 // indirect
9492
github.com/inconshreveable/mousetrap v1.1.0 // indirect
9593
github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf // indirect
9694
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
97-
github.com/klauspost/compress v1.18.2 // indirect
98-
github.com/magiconair/properties v1.8.9 // indirect
95+
github.com/klauspost/compress v1.18.3 // indirect
9996
github.com/mattn/go-colorable v0.1.14 // indirect
10097
github.com/mattn/go-isatty v0.0.20 // indirect
10198
github.com/mattn/go-runewidth v0.0.16 // indirect
10299
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
103-
github.com/miekg/pkcs11 v1.1.1 // indirect
104100
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
105-
github.com/mitchellh/mapstructure v1.5.0 // indirect
106101
github.com/moby/docker-image-spec v1.3.1 // indirect
107102
github.com/moby/locker v1.0.1 // indirect
108103
github.com/moby/sys/capability v0.4.0 // indirect
@@ -112,24 +107,20 @@ require (
112107
github.com/moby/sys/user v0.4.0 // indirect
113108
github.com/moby/sys/userns v0.1.0 // indirect
114109
github.com/moby/term v0.5.2 // indirect
115-
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
116110
github.com/otiai10/mint v1.6.3 // indirect
117111
github.com/pelletier/go-toml v1.9.5 // indirect
118112
github.com/pkg/errors v0.9.1 // indirect
119113
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
120114
github.com/pmezard/go-difflib v1.0.0 // indirect
121-
github.com/prometheus/client_golang v1.23.2 // indirect
122-
github.com/prometheus/client_model v0.6.2 // indirect
123-
github.com/prometheus/common v0.66.1 // indirect
124-
github.com/prometheus/procfs v0.16.1 // indirect
125-
github.com/rivo/uniseg v0.2.0 // indirect
115+
github.com/rivo/uniseg v0.4.7 // indirect
126116
github.com/russross/blackfriday/v2 v2.1.0 // indirect
127117
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
128118
github.com/secure-systems-lab/go-securesystemslib v0.9.1 // indirect
129119
github.com/shibumi/go-pathspec v1.3.0 // indirect
130-
github.com/theupdateframework/notary v0.7.0 // indirect
120+
github.com/sigstore/sigstore v1.10.0 // indirect
121+
github.com/sigstore/sigstore-go v1.1.4-0.20251124094504-b5fe07a5a7d7 // indirect
131122
github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 // indirect
132-
github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f // indirect
123+
github.com/tonistiigi/fsutil v0.0.0-20251211185533-a2aa163d723f // indirect
133124
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect
134125
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
135126
github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect
@@ -142,16 +133,24 @@ require (
142133
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0 // indirect
143134
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
144135
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
145-
go.yaml.in/yaml/v2 v2.4.2 // indirect
146136
go.yaml.in/yaml/v3 v3.0.4 // indirect
147-
golang.org/x/crypto v0.45.0 // indirect
148-
golang.org/x/net v0.47.0 // indirect
149-
golang.org/x/term v0.37.0 // indirect
150-
golang.org/x/text v0.31.0 // indirect
137+
golang.org/x/crypto v0.46.0 // indirect
138+
golang.org/x/net v0.48.0 // indirect
139+
golang.org/x/term v0.38.0 // indirect
140+
golang.org/x/text v0.32.0 // indirect
151141
golang.org/x/time v0.14.0 // indirect
152-
google.golang.org/genproto/googleapis/api v0.0.0-20251029180050-ab9386a59fda // indirect
153-
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda // indirect
154-
google.golang.org/protobuf v1.36.10 // indirect
142+
google.golang.org/genproto/googleapis/api v0.0.0-20251103181224-f26f9409b101 // indirect
143+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251103181224-f26f9409b101 // indirect
144+
google.golang.org/protobuf v1.36.11 // indirect
155145
gopkg.in/ini.v1 v1.67.0 // indirect
156146
gopkg.in/yaml.v3 v3.0.1 // indirect
157147
)
148+
149+
exclude (
150+
// FIXME(thaJeztah): remove this once kubernetes updated their dependencies to no longer need this.
151+
//
152+
// For additional details, see this PR and links mentioned in that PR:
153+
// https://github.com/kubernetes-sigs/kustomize/pull/5830#issuecomment-2569960859
154+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
155+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
156+
)

0 commit comments

Comments
 (0)