Skip to content

Commit 5358042

Browse files
committed
go.mod: bump github.com/moby/moby/api v1.52.0, moby/client v0.1.0
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 9de7e2a commit 5358042

Some content is hidden

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

70 files changed

+2051
-2280
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/[email protected]
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/v2/cmd/formatter"

cmd/compose/images.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import (
2828
"github.com/containerd/platforms"
2929
"github.com/docker/cli/cli/command"
3030
"github.com/docker/compose/v2/pkg/compose"
31-
"github.com/docker/docker/pkg/stringid"
3231
"github.com/docker/go-units"
32+
"github.com/moby/moby/client/pkg/stringid"
3333
"github.com/spf13/cobra"
3434

3535
"github.com/docker/compose/v2/cmd/formatter"

cmd/compose/list.go

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ 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/compose/v2/cmd/formatter"
2729
"github.com/docker/compose/v2/pkg/compose"
30+
"github.com/moby/moby/client"
2831

2932
"github.com/docker/cli/opts"
3033
"github.com/spf13/cobra"
@@ -62,11 +65,32 @@ var acceptedListFilters = map[string]bool{
6265
"name": true,
6366
}
6467

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

7296
backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...)
@@ -78,13 +102,12 @@ func runList(ctx context.Context, dockerCli command.Cli, backendOptions *Backend
78102
return err
79103
}
80104

81-
if filters.Len() > 0 {
105+
if len(filters) > 0 {
82106
var filtered []api.Stack
83107
for _, s := range stackList {
84-
if filters.Contains("name") && !filters.Match("name", s.Name) {
85-
continue
108+
if match(filters, "name", s.Name) {
109+
filtered = append(filtered, s)
86110
}
87-
filtered = append(filtered, s)
88111
}
89112
stackList = filtered
90113
}

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/v2/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,15 +18,16 @@ 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"
2627
"github.com/docker/compose/v2/pkg/api"
27-
"github.com/docker/docker/api/types/container"
28-
"github.com/docker/docker/pkg/stringid"
2928
"github.com/docker/go-units"
29+
"github.com/moby/moby/api/types/container"
30+
"github.com/moby/moby/client/pkg/stringid"
3031
)
3132

3233
const (
@@ -196,26 +197,32 @@ func (c *ContainerContext) ExitCode() int {
196197
}
197198

198199
func (c *ContainerContext) State() string {
199-
return c.c.State
200+
return string(c.c.State)
200201
}
201202

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

206207
func (c *ContainerContext) Health() string {
207-
return c.c.Health
208+
return string(c.c.Health)
208209
}
209210

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

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

cmd/formatter/logs.go

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

2828
"github.com/buger/goterm"
2929
"github.com/docker/compose/v2/pkg/api"
30-
"github.com/docker/docker/pkg/jsonmessage"
30+
"github.com/moby/moby/client/pkg/jsonmessage"
3131
)
3232

3333
// LogConsumer consume logs from services and format them

go.mod

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module github.com/docker/compose/v2
22

33
go 1.24.9
44

5+
replace github.com/docker/buildx => github.com/thaJeztah/buildx v0.2.1-0.20251110233353-a736ed2f4ebf // https://github.com/docker/buildx/pull/3326
6+
57
require (
68
github.com/AlecAivazis/survey/v2 v2.3.7
79
github.com/DefangLabs/secret-detector v0.0.0-20250403165618-22662109213e
@@ -15,7 +17,7 @@ require (
1517
github.com/containerd/platforms v1.0.0-rc.2
1618
github.com/distribution/reference v0.6.0
1719
github.com/docker/buildx v0.29.1
18-
github.com/docker/cli v28.5.2+incompatible
20+
github.com/docker/cli v29.0.0+incompatible
1921
github.com/docker/cli-docs-tool v0.10.0
2022
github.com/docker/docker v28.5.2+incompatible
2123
github.com/docker/go-connections v0.6.0
@@ -29,8 +31,10 @@ require (
2931
github.com/jonboulle/clockwork v0.5.0
3032
github.com/mattn/go-shellwords v1.0.12
3133
github.com/mitchellh/go-ps v1.0.0
32-
github.com/moby/buildkit v0.25.2
34+
github.com/moby/buildkit v0.26.0-rc1
3335
github.com/moby/go-archive v0.1.0
36+
github.com/moby/moby/api v1.52.0
37+
github.com/moby/moby/client v0.1.0
3438
github.com/moby/patternmatcher v0.6.0
3539
github.com/moby/sys/atomicwriter v0.1.0
3640
github.com/moby/term v0.5.2
@@ -44,13 +48,13 @@ require (
4448
github.com/spf13/pflag v1.0.10
4549
github.com/stretchr/testify v1.11.1
4650
github.com/tilt-dev/fsnotify v1.4.8-0.20220602155310-fff9c274a375
47-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0
48-
go.opentelemetry.io/otel v1.37.0
49-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0
50-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0
51-
go.opentelemetry.io/otel/metric v1.37.0
52-
go.opentelemetry.io/otel/sdk v1.37.0
53-
go.opentelemetry.io/otel/trace v1.37.0
51+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0
52+
go.opentelemetry.io/otel v1.38.0
53+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0
54+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0
55+
go.opentelemetry.io/otel/metric v1.38.0
56+
go.opentelemetry.io/otel/sdk v1.38.0
57+
go.opentelemetry.io/otel/trace v1.38.0
5458
go.uber.org/goleak v1.3.0
5559
go.uber.org/mock v0.6.0
5660
golang.org/x/sync v0.18.0
@@ -63,9 +67,7 @@ require (
6367

6468
require (
6569
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
66-
github.com/beorn7/perks v1.0.1 // indirect
67-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
68-
github.com/cespare/xxhash/v2 v2.3.0 // indirect
70+
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
6971
github.com/containerd/containerd/api v1.10.0 // indirect
7072
github.com/containerd/continuity v0.4.5 // indirect
7173
github.com/containerd/errdefs/pkg v0.3.0 // indirect
@@ -74,36 +76,30 @@ require (
7476
github.com/containerd/typeurl/v2 v2.2.3 // indirect
7577
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
7678
github.com/davecgh/go-spew v1.1.1 // indirect
77-
github.com/docker/distribution v2.8.3+incompatible // indirect
7879
github.com/docker/docker-credential-helpers v0.9.3 // indirect
79-
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
80-
github.com/docker/go-metrics v0.0.1 // indirect
8180
github.com/felixge/httpsnoop v1.0.4 // indirect
8281
github.com/fvbommel/sortorder v1.1.0 // indirect
8382
github.com/go-logr/logr v1.4.3 // indirect
8483
github.com/go-logr/stdr v1.2.2 // indirect
85-
github.com/gofrs/flock v0.12.1 // indirect
84+
github.com/gofrs/flock v0.13.0 // indirect
8685
github.com/gogo/protobuf v1.3.2 // indirect
87-
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
86+
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
8887
github.com/golang/protobuf v1.5.4 // indirect
8988
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
9089
github.com/gorilla/mux v1.8.1 // indirect
91-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect
90+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
9291
github.com/hashicorp/errwrap v1.1.0 // indirect
9392
github.com/hashicorp/go-multierror v1.1.1 // indirect
9493
github.com/in-toto/in-toto-golang v0.9.0 // indirect
9594
github.com/inconshreveable/mousetrap v1.1.0 // indirect
9695
github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf // indirect
9796
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
9897
github.com/klauspost/compress v1.18.1 // indirect
99-
github.com/magiconair/properties v1.8.9 // indirect
100-
github.com/mattn/go-colorable v0.1.13 // indirect
98+
github.com/mattn/go-colorable v0.1.14 // indirect
10199
github.com/mattn/go-isatty v0.0.20 // indirect
102100
github.com/mattn/go-runewidth v0.0.16 // indirect
103101
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
104-
github.com/miekg/pkcs11 v1.1.1 // indirect
105102
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
106-
github.com/mitchellh/mapstructure v1.5.0 // indirect
107103
github.com/moby/docker-image-spec v1.3.1 // indirect
108104
github.com/moby/locker v1.0.1 // indirect
109105
github.com/moby/sys/capability v0.4.0 // indirect
@@ -112,45 +108,38 @@ require (
112108
github.com/moby/sys/symlink v0.3.0 // indirect
113109
github.com/moby/sys/user v0.4.0 // indirect
114110
github.com/moby/sys/userns v0.1.0 // indirect
115-
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
116111
github.com/otiai10/mint v1.6.3 // indirect
117112
github.com/pelletier/go-toml v1.9.5 // indirect
118113
github.com/pkg/errors v0.9.1 // indirect
119114
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
120115
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
125116
github.com/rivo/uniseg v0.2.0 // indirect
126117
github.com/russross/blackfriday/v2 v2.1.0 // indirect
127118
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
128-
github.com/secure-systems-lab/go-securesystemslib v0.6.0 // indirect
119+
github.com/secure-systems-lab/go-securesystemslib v0.9.1 // indirect
129120
github.com/shibumi/go-pathspec v1.3.0 // indirect
130-
github.com/theupdateframework/notary v0.7.0 // indirect
131121
github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 // indirect
132122
github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f // indirect
133123
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect
134124
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
135125
github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect
136126
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
137-
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
138-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
139-
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.60.0 // indirect
140-
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 // indirect
141-
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0 // indirect
142-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 // indirect
143-
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
144-
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
145-
go.yaml.in/yaml/v2 v2.4.2 // indirect
127+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
128+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
129+
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.61.0 // indirect
130+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.38.0 // indirect
131+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.38.0 // indirect
132+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0 // indirect
133+
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
134+
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
146135
go.yaml.in/yaml/v3 v3.0.4 // indirect
147-
golang.org/x/crypto v0.41.0 // indirect
148-
golang.org/x/net v0.43.0 // indirect
149-
golang.org/x/term v0.34.0 // indirect
150-
golang.org/x/text v0.28.0 // indirect
136+
golang.org/x/crypto v0.42.0 // indirect
137+
golang.org/x/net v0.44.0 // indirect
138+
golang.org/x/term v0.35.0 // indirect
139+
golang.org/x/text v0.29.0 // indirect
151140
golang.org/x/time v0.14.0 // indirect
152-
google.golang.org/genproto/googleapis/api v0.0.0-20250804133106-a7a43d27e69b // indirect
153-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect
141+
google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect
142+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect
154143
google.golang.org/protobuf v1.36.10 // indirect
155144
gopkg.in/ini.v1 v1.67.0 // indirect
156145
)

0 commit comments

Comments
 (0)