Skip to content

Commit 7ae4dfe

Browse files
committed
upgrade dependencies and move to containerd/v2
1 parent fdfdf9a commit 7ae4dfe

File tree

7 files changed

+391
-412
lines changed

7 files changed

+391
-412
lines changed

cmd/exec/exec_containerd.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import (
1212
"time"
1313

1414
"github.com/containerd/console"
15-
offcontainerd "github.com/containerd/containerd"
16-
"github.com/containerd/containerd/cio"
17-
"github.com/containerd/containerd/cmd/ctr/commands"
18-
"github.com/containerd/containerd/cmd/ctr/commands/tasks"
19-
"github.com/containerd/containerd/containers"
20-
"github.com/containerd/containerd/namespaces"
21-
"github.com/containerd/containerd/oci"
22-
"github.com/containerd/containerd/platforms"
15+
offcontainerd "github.com/containerd/containerd/v2/client"
16+
"github.com/containerd/containerd/v2/cmd/ctr/commands"
17+
"github.com/containerd/containerd/v2/cmd/ctr/commands/tasks"
18+
"github.com/containerd/containerd/v2/core/containers"
19+
"github.com/containerd/containerd/v2/pkg/cio"
20+
"github.com/containerd/containerd/v2/pkg/namespaces"
21+
"github.com/containerd/containerd/v2/pkg/oci"
22+
"github.com/containerd/platforms"
2323
"github.com/opencontainers/runtime-spec/specs-go"
2424
"github.com/sirupsen/logrus"
2525

cmd/exec/exec_docker.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/docker/docker/api/types"
1010
"github.com/docker/docker/api/types/container"
11+
"github.com/docker/docker/api/types/image"
1112
"github.com/docker/docker/pkg/stdcopy"
1213
"github.com/sirupsen/logrus"
1314

@@ -45,7 +46,7 @@ func runDebuggerDocker(ctx context.Context, cli cliutil.CLI, opts *options) erro
4546
}
4647
if !imageExists {
4748
cli.PrintAux("Pulling debugger image...\n")
48-
if err := client.ImagePullEx(ctx, opts.image, types.ImagePullOptions{
49+
if err := client.ImagePullEx(ctx, opts.image, image.PullOptions{
4950
Platform: platform,
5051
}); err != nil {
5152
return errCannotPull(opts.image, err)

cmd/portforward/portforward.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"sync"
1010
"time"
1111

12-
"github.com/docker/docker/api/types"
1312
"github.com/docker/docker/api/types/container"
1413
"github.com/docker/docker/api/types/filters"
14+
"github.com/docker/docker/api/types/image"
1515
dockerclient "github.com/docker/docker/client"
1616
"github.com/docker/go-connections/nat"
1717
"github.com/sirupsen/logrus"
@@ -149,15 +149,15 @@ func runPortForward(ctx context.Context, cli cliutil.CLI, opts *options) error {
149149
}
150150

151151
// Find existing forwarder image.
152-
images, err := client.ImageList(ctx, types.ImageListOptions{
152+
images, err := client.ImageList(ctx, image.ListOptions{
153153
All: true,
154154
Filters: filters.NewArgs(
155155
filters.Arg("reference", forwarderImage),
156156
),
157157
})
158158
if err != nil || len(images) == 0 {
159159
cli.PrintAux("Pulling forwarder image...\n")
160-
if err := client.ImagePullEx(ctx, forwarderImage, types.ImagePullOptions{
160+
if err := client.ImagePullEx(ctx, forwarderImage, image.PullOptions{
161161
// Platform: ... TODO: Test if an arm64 sidecar can be attached to an amd64 target and vice versa.
162162
}); err != nil {
163163
return fmt.Errorf("cannot pull forwarder image %q: %w", forwarderImage, err)
@@ -253,7 +253,7 @@ func getRunningTarget(
253253
client dockerclient.CommonAPIClient,
254254
target string,
255255
runningTimeout time.Duration,
256-
) (types.ContainerJSON, error) {
256+
) (container.InspectResponse, error) {
257257
ctx, cancel := context.WithTimeout(ctx, runningTimeout)
258258
defer cancel()
259259

@@ -274,7 +274,7 @@ func getRunningTarget(
274274
}
275275
}
276276

277-
func validateTarget(target types.ContainerJSON) error {
277+
func validateTarget(target container.InspectResponse) error {
278278
hasIP := false
279279
for _, net := range target.NetworkSettings.Networks {
280280
hasIP = hasIP || len(net.IPAddress) > 0
@@ -307,7 +307,7 @@ type sidecarForwarding struct {
307307
}
308308

309309
func parseLocalForwardings(
310-
target types.ContainerJSON,
310+
target container.InspectResponse,
311311
locals []string,
312312
) ([]forwarding, error) {
313313
var parsed []forwarding
@@ -322,7 +322,7 @@ func parseLocalForwardings(
322322
}
323323

324324
func parseLocalForwarding(
325-
target types.ContainerJSON,
325+
target container.InspectResponse,
326326
local string,
327327
) (forwarding, error) {
328328
parts := strings.Split(local, ":")
@@ -412,7 +412,7 @@ func parseLocalForwarding(
412412
}, nil
413413
}
414414

415-
func unambiguousIP(target types.ContainerJSON) (string, error) {
415+
func unambiguousIP(target container.InspectResponse) (string, error) {
416416
var found string
417417
for _, net := range target.NetworkSettings.Networks {
418418
if len(net.IPAddress) > 0 {
@@ -431,7 +431,7 @@ func unambiguousIP(target types.ContainerJSON) (string, error) {
431431
return found, nil
432432
}
433433

434-
func lookupTargetIP(target types.ContainerJSON, ipAliasNetwork string) (string, error) {
434+
func lookupTargetIP(target container.InspectResponse, ipAliasNetwork string) (string, error) {
435435
for name, net := range target.NetworkSettings.Networks {
436436
if len(net.IPAddress) == 0 {
437437
continue
@@ -455,7 +455,7 @@ func lookupTargetIP(target types.ContainerJSON, ipAliasNetwork string) (string,
455455
return "", errors.New("cannot derive remote host")
456456
}
457457

458-
func lookupPortBindings(target types.ContainerJSON, targetPort string) []nat.PortBinding {
458+
func lookupPortBindings(target container.InspectResponse, targetPort string) []nat.PortBinding {
459459
for port, bindings := range target.NetworkSettings.Ports {
460460
if targetPort == port.Port() {
461461
return bindings
@@ -464,7 +464,7 @@ func lookupPortBindings(target types.ContainerJSON, targetPort string) []nat.Por
464464
return nil
465465
}
466466

467-
func targetNetworkByIP(target types.ContainerJSON, ip string) (string, error) {
467+
func targetNetworkByIP(target container.InspectResponse, ip string) (string, error) {
468468
for name, net := range target.NetworkSettings.Networks {
469469
if net.IPAddress == ip {
470470
return name, nil
@@ -477,7 +477,7 @@ func startLocalForwarders(
477477
ctx context.Context,
478478
cli cliutil.CLI,
479479
client dockerclient.CommonAPIClient,
480-
target types.ContainerJSON,
480+
target container.InspectResponse,
481481
locals []forwarding,
482482
) <-chan error {
483483
doneCh := make(chan error, 1)
@@ -513,7 +513,7 @@ func runLocalForwarder(
513513
ctx context.Context,
514514
cli cliutil.CLI,
515515
client dockerclient.CommonAPIClient,
516-
target types.ContainerJSON,
516+
target container.InspectResponse,
517517
fwd forwarding,
518518
) error {
519519
if len(fwd.localHost) == 0 {

go.mod

Lines changed: 103 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,134 @@
11
module github.com/iximiuz/cdebug
22

3-
go 1.22
3+
go 1.25.0
44

55
require (
6-
github.com/containerd/console v1.0.4
7-
github.com/containerd/containerd v1.7.15
6+
github.com/containerd/console v1.0.5
7+
github.com/containerd/containerd/v2 v2.2.1
88
github.com/distribution/reference v0.6.0
9-
github.com/docker/cli v26.0.1+incompatible
10-
github.com/docker/docker v26.0.1+incompatible
11-
github.com/docker/go-connections v0.5.0
12-
github.com/evanphx/json-patch v5.9.0+incompatible
9+
github.com/docker/cli v29.1.5+incompatible
10+
github.com/docker/docker v28.5.2+incompatible
11+
github.com/docker/go-connections v0.6.0
12+
github.com/evanphx/json-patch v5.9.11+incompatible
1313
github.com/google/uuid v1.6.0
14-
github.com/moby/sys/signal v0.7.0
15-
github.com/moby/term v0.5.0
16-
github.com/opencontainers/runtime-spec v1.2.0
17-
github.com/sirupsen/logrus v1.9.3
18-
github.com/spf13/cobra v1.8.0
19-
golang.org/x/sys v0.21.0
14+
github.com/moby/sys/signal v0.7.1
15+
github.com/moby/term v0.5.2
16+
github.com/opencontainers/runtime-spec v1.3.0
17+
github.com/sirupsen/logrus v1.9.4
18+
github.com/spf13/cobra v1.10.2
19+
golang.org/x/sys v0.40.0
2020
gotest.tools v2.2.0+incompatible
2121
gotest.tools/v3 v3.4.0
22-
k8s.io/api v0.29.3
23-
k8s.io/apimachinery v0.29.3
24-
k8s.io/client-go v0.29.3
22+
k8s.io/api v0.35.0
23+
k8s.io/apimachinery v0.35.0
24+
k8s.io/client-go v0.35.0
2525
)
2626

27-
require github.com/stretchr/objx v0.5.2 // indirect
27+
require (
28+
cyphar.com/go-pathrs v0.2.2 // indirect
29+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
30+
github.com/containerd/containerd/api v1.10.0 // indirect
31+
github.com/containerd/errdefs v1.0.0
32+
github.com/containerd/errdefs/pkg v0.3.0 // indirect
33+
github.com/containerd/platforms v1.0.0-rc.2
34+
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
35+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
36+
github.com/go-openapi/swag/cmdutils v0.25.4 // indirect
37+
github.com/go-openapi/swag/conv v0.25.4 // indirect
38+
github.com/go-openapi/swag/fileutils v0.25.4 // indirect
39+
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
40+
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
41+
github.com/go-openapi/swag/loading v0.25.4 // indirect
42+
github.com/go-openapi/swag/mangling v0.25.4 // indirect
43+
github.com/go-openapi/swag/netutils v0.25.4 // indirect
44+
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
45+
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
46+
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
47+
github.com/moby/sys/atomicwriter v0.1.0 // indirect
48+
github.com/moby/sys/userns v0.1.0 // indirect
49+
github.com/petermattis/goid v0.0.0-20260113132338-7c7de50cc741 // indirect
50+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
51+
github.com/sasha-s/go-deadlock v0.3.6 // indirect
52+
github.com/x448/float16 v0.8.4 // indirect
53+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
54+
go.yaml.in/yaml/v2 v2.4.3 // indirect
55+
go.yaml.in/yaml/v3 v3.0.4 // indirect
56+
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
57+
sigs.k8s.io/randfill v1.0.0 // indirect
58+
sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect
59+
)
2860

2961
require (
30-
github.com/99designs/gqlgen v0.17.49
31-
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
32-
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
33-
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
34-
github.com/Khan/genqlient v0.7.0
35-
github.com/Microsoft/go-winio v0.6.1 // indirect
36-
github.com/Microsoft/hcsshim v0.11.4 // indirect
37-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
38-
github.com/containerd/cgroups v1.1.0 // indirect
39-
github.com/containerd/cgroups/v3 v3.0.2 // indirect
40-
github.com/containerd/continuity v0.4.2 // indirect
62+
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
63+
github.com/Microsoft/go-winio v0.6.2 // indirect
64+
github.com/Microsoft/hcsshim v0.14.0-rc.1 // indirect
65+
github.com/containerd/cgroups/v3 v3.1.2 // indirect
66+
github.com/containerd/continuity v0.4.5 // indirect
4167
github.com/containerd/fifo v1.1.0 // indirect
42-
github.com/containerd/go-cni v1.1.9 // indirect
68+
github.com/containerd/go-cni v1.1.13 // indirect
4369
github.com/containerd/log v0.1.0 // indirect
44-
github.com/containerd/ttrpc v1.2.3 // indirect
45-
github.com/containerd/typeurl/v2 v2.1.1 // indirect
46-
github.com/containernetworking/cni v1.1.2 // indirect
47-
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
70+
github.com/containerd/plugin v1.0.0 // indirect
71+
github.com/containerd/ttrpc v1.2.7 // indirect
72+
github.com/containerd/typeurl/v2 v2.2.3 // indirect
73+
github.com/containernetworking/cni v1.3.0 // indirect
74+
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
4875
github.com/davecgh/go-spew v1.1.1 // indirect
49-
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
5076
github.com/docker/go-units v0.5.0 // indirect
51-
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
52-
github.com/felixge/httpsnoop v1.0.3 // indirect
53-
github.com/go-logr/logr v1.4.1 // indirect
77+
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
78+
github.com/felixge/httpsnoop v1.0.4 // indirect
79+
github.com/go-logr/logr v1.4.3 // indirect
5480
github.com/go-logr/stdr v1.2.2 // indirect
55-
github.com/go-openapi/jsonpointer v0.19.6 // indirect
56-
github.com/go-openapi/jsonreference v0.20.2 // indirect
57-
github.com/go-openapi/swag v0.22.3 // indirect
81+
github.com/go-openapi/jsonpointer v0.22.4 // indirect
82+
github.com/go-openapi/jsonreference v0.21.4 // indirect
83+
github.com/go-openapi/swag v0.25.4 // indirect
5884
github.com/gogo/protobuf v1.3.2 // indirect
59-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
60-
github.com/golang/protobuf v1.5.4 // indirect
61-
github.com/google/gnostic-models v0.6.8 // indirect
62-
github.com/google/go-cmp v0.6.0 // indirect
63-
github.com/google/gofuzz v1.2.0 // indirect
64-
github.com/gorilla/websocket v1.5.0 // indirect
65-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
66-
github.com/imdario/mergo v0.3.6 // indirect
85+
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
86+
github.com/google/gnostic-models v0.7.1 // indirect
87+
github.com/google/go-cmp v0.7.0 // indirect
88+
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
6789
github.com/inconshreveable/mousetrap v1.1.0 // indirect
68-
github.com/josharian/intern v1.0.0 // indirect
6990
github.com/json-iterator/go v1.1.12 // indirect
70-
github.com/klauspost/compress v1.16.0 // indirect
71-
github.com/mailru/easyjson v0.7.7 // indirect
91+
github.com/klauspost/compress v1.18.3 // indirect
7292
github.com/moby/docker-image-spec v1.3.1 // indirect
7393
github.com/moby/locker v1.0.1 // indirect
74-
github.com/moby/spdystream v0.2.0 // indirect
75-
github.com/moby/sys/mountinfo v0.6.2 // indirect
76-
github.com/moby/sys/sequential v0.5.0 // indirect
77-
github.com/moby/sys/user v0.1.0 // indirect
94+
github.com/moby/spdystream v0.5.0 // indirect
95+
github.com/moby/sys/mountinfo v0.7.2 // indirect
96+
github.com/moby/sys/sequential v0.6.0 // indirect
97+
github.com/moby/sys/user v0.4.0 // indirect
7898
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
79-
github.com/modern-go/reflect2 v1.0.2 // indirect
80-
github.com/morikuni/aec v1.0.0 // indirect
99+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
100+
github.com/morikuni/aec v1.1.0 // indirect
81101
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
82102
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
83103
github.com/opencontainers/go-digest v1.0.0 // indirect
84-
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect
85-
github.com/opencontainers/selinux v1.11.0 // indirect
86-
github.com/pelletier/go-toml v1.9.5 // indirect
104+
github.com/opencontainers/image-spec v1.1.1 // indirect
105+
github.com/opencontainers/selinux v1.13.1 // indirect
106+
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
87107
github.com/pkg/errors v0.9.1 // indirect
88108
github.com/russross/blackfriday/v2 v2.1.0 // indirect
89-
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
90-
github.com/sosodev/duration v1.3.1 // indirect
91-
github.com/spf13/pflag v1.0.5 // indirect
92-
github.com/urfave/cli v1.22.12 // indirect
93-
github.com/vektah/gqlparser/v2 v2.5.16
109+
github.com/spf13/pflag v1.0.10 // indirect
110+
github.com/urfave/cli/v2 v2.27.7 // indirect
111+
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
94112
go.opencensus.io v0.24.0 // indirect
95-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
96-
go.opentelemetry.io/otel v1.27.0
97-
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240518090000-14441aefdf88
98-
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.3.0
99-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect
100-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0
101-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0
102-
go.opentelemetry.io/otel/log v0.3.0
103-
go.opentelemetry.io/otel/metric v1.27.0 // indirect
104-
go.opentelemetry.io/otel/sdk v1.27.0
105-
go.opentelemetry.io/otel/sdk/log v0.3.0
106-
go.opentelemetry.io/otel/trace v1.27.0
107-
go.opentelemetry.io/proto/otlp v1.3.1
108-
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
109-
golang.org/x/mod v0.18.0 // indirect
110-
golang.org/x/net v0.26.0 // indirect
111-
golang.org/x/oauth2 v0.20.0 // indirect
112-
golang.org/x/sync v0.7.0
113-
golang.org/x/term v0.21.0 // indirect
114-
golang.org/x/text v0.16.0 // indirect
115-
golang.org/x/time v0.3.0 // indirect
116-
golang.org/x/tools v0.22.0 // indirect
117-
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
118-
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect
119-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
120-
google.golang.org/grpc v1.64.0
121-
google.golang.org/protobuf v1.34.1 // indirect
113+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 // indirect
114+
go.opentelemetry.io/otel v1.39.0 // indirect
115+
go.opentelemetry.io/otel/metric v1.39.0 // indirect
116+
go.opentelemetry.io/otel/trace v1.39.0 // indirect
117+
golang.org/x/net v0.49.0 // indirect
118+
golang.org/x/oauth2 v0.34.0 // indirect
119+
golang.org/x/sync v0.19.0 // indirect
120+
golang.org/x/term v0.39.0 // indirect
121+
golang.org/x/text v0.33.0 // indirect
122+
golang.org/x/time v0.14.0 // indirect
123+
golang.org/x/tools v0.41.0 // indirect
124+
google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect
125+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 // indirect
126+
google.golang.org/grpc v1.78.0 // indirect
127+
google.golang.org/protobuf v1.36.11 // indirect
122128
gopkg.in/inf.v0 v0.9.1 // indirect
123-
gopkg.in/yaml.v2 v2.4.0 // indirect
124-
gopkg.in/yaml.v3 v3.0.1 // indirect
125-
k8s.io/klog/v2 v2.110.1 // indirect
126-
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
127-
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
128-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
129-
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
130-
sigs.k8s.io/yaml v1.3.0 // indirect
129+
k8s.io/klog/v2 v2.130.1 // indirect
130+
k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect
131+
k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect
132+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
133+
sigs.k8s.io/yaml v1.6.0 // indirect
131134
)

0 commit comments

Comments
 (0)