Skip to content

Commit a3c5683

Browse files
committed
use Marshal funcs from containerd and fix typeurl
Signed-off-by: Akhil Mohan <[email protected]>
1 parent ad3cbfc commit a3c5683

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cmd/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
112112
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
113113
github.com/containerd/ttrpc v1.2.4 h1:eQCQK4h9dxDmpOb9QOOMh2NHTfzroH1IkmHiKZi05Oo=
114114
github.com/containerd/ttrpc v1.2.4/go.mod h1:ojvb8SJBSch0XkqNO0L0YX/5NxR3UnVk2LzFKBK0upc=
115-
github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY=
116-
github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s=
115+
github.com/containerd/typeurl/v2 v2.1.2-0.20240708140135-933576d917b1 h1:WwfOZHEkarV+hX77m86L9ySq8Q156OyE4Gqez9mkgJU=
116+
github.com/containerd/typeurl/v2 v2.1.2-0.20240708140135-933576d917b1/go.mod h1:8XOOxnyatxSWuG8OfsZXVnAF4iZfedjS/8UHSPJnX4g=
117117
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 h1:rtAn27wIbmOGUs7RIbVgPEjb31ehTVniDwPGXyMxm5U=
118118
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
119119
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=

container/containerd/factory_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
package containerd
1616

1717
import (
18+
"github.com/containerd/typeurl/v2"
1819
"testing"
1920

20-
"github.com/containerd/typeurl"
2121
"github.com/google/cadvisor/container/containerd/containers"
2222
specs "github.com/opencontainers/runtime-spec/specs-go"
2323
"github.com/stretchr/testify/assert"
@@ -52,7 +52,7 @@ func TestCanHandleAndAccept(t *testing.T) {
5252
Labels: map[string]string{"io.cri-containerd.kind": "sandbox"},
5353
}
5454
spec := &specs.Spec{Root: &specs.Root{Path: "/test/"}, Process: &specs.Process{}}
55-
testContainer.Spec, _ = typeurl.MarshalAny(spec)
55+
testContainer.Spec, _ = typeurl.MarshalAnyToProto(spec)
5656
testContainers["40af7cdcbe507acad47a5a62025743ad3ddc6ab93b77b21363aa1c1d641047c9"] = testContainer
5757

5858
f := &containerdFactory{

container/containerd/handler_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package containerd
1818
import (
1919
"testing"
2020

21-
"github.com/containerd/typeurl"
21+
"github.com/containerd/typeurl/v2"
2222
specs "github.com/opencontainers/runtime-spec/specs-go"
2323
"github.com/stretchr/testify/assert"
2424

@@ -65,7 +65,7 @@ func TestHandler(t *testing.T) {
6565
Labels: map[string]string{"io.cri-containerd.kind": "sandbox"},
6666
}
6767
spec := &specs.Spec{Root: &specs.Root{Path: "/test/"}, Process: &specs.Process{Env: []string{"TEST_REGION=FRA", "TEST_ZONE=A", "HELLO=WORLD"}}}
68-
testContainer.Spec, _ = typeurl.MarshalAny(spec)
68+
testContainer.Spec, _ = typeurl.MarshalAnyToProto(spec)
6969
testContainers["40af7cdcbe507acad47a5a62025743ad3ddc6ab93b77b21363aa1c1d641047c9"] = testContainer
7070
for _, ts := range []testCase{
7171
{

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ require (
1010
github.com/blang/semver/v4 v4.0.0
1111
github.com/containerd/containerd/api v1.8.0-rc.2
1212
github.com/containerd/ttrpc v1.2.4
13-
github.com/containerd/typeurl v1.0.2
13+
github.com/containerd/typeurl/v2 v2.1.2-0.20240708140135-933576d917b1
1414
github.com/docker/docker v26.1.4+incompatible
1515
github.com/docker/go-connections v0.5.0
1616
github.com/docker/go-units v0.5.0
1717
github.com/euank/go-kmsg-parser v2.0.0+incompatible
18-
github.com/gogo/protobuf v1.3.2
1918
github.com/karrick/godirwalk v1.17.0
2019
github.com/mistifyio/go-zfs v2.1.1+incompatible
2120
github.com/moby/sys/mountinfo v0.7.1
@@ -29,6 +28,7 @@ require (
2928
golang.org/x/net v0.26.0
3029
golang.org/x/sys v0.21.0
3130
google.golang.org/grpc v1.64.1
31+
google.golang.org/protobuf v1.34.1
3232
k8s.io/klog/v2 v2.100.1
3333
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
3434
)
@@ -60,6 +60,7 @@ require (
6060
github.com/go-logr/logr v1.4.1 // indirect
6161
github.com/go-logr/stdr v1.2.2 // indirect
6262
github.com/godbus/dbus/v5 v5.0.6 // indirect
63+
github.com/gogo/protobuf v1.3.2 // indirect
6364
github.com/golang/protobuf v1.5.4 // indirect
6465
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
6566
github.com/moby/docker-image-spec v1.3.1 // indirect
@@ -85,7 +86,6 @@ require (
8586
go.opentelemetry.io/otel/trace v1.27.0 // indirect
8687
golang.org/x/text v0.16.0 // indirect
8788
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
88-
google.golang.org/protobuf v1.34.1 // indirect
8989
gopkg.in/yaml.v3 v3.0.1 // indirect
9090
gotest.tools/v3 v3.0.2 // indirect
9191
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
102102
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
103103
github.com/containerd/ttrpc v1.2.4 h1:eQCQK4h9dxDmpOb9QOOMh2NHTfzroH1IkmHiKZi05Oo=
104104
github.com/containerd/ttrpc v1.2.4/go.mod h1:ojvb8SJBSch0XkqNO0L0YX/5NxR3UnVk2LzFKBK0upc=
105-
github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY=
106-
github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s=
105+
github.com/containerd/typeurl/v2 v2.1.2-0.20240708140135-933576d917b1 h1:WwfOZHEkarV+hX77m86L9ySq8Q156OyE4Gqez9mkgJU=
106+
github.com/containerd/typeurl/v2 v2.1.2-0.20240708140135-933576d917b1/go.mod h1:8XOOxnyatxSWuG8OfsZXVnAF4iZfedjS/8UHSPJnX4g=
107107
github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
108108
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
109109
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=

0 commit comments

Comments
 (0)