go.mod: github.com/containerd/typeurl/v2 v2.1.0

Changes: https://github.com/containerd/typeurl/compare/7f6e6d160d67...v2.1.0

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2023-02-11 23:30:32 +09:00
parent cf7b705dcd
commit b61988670c
No known key found for this signature in database
GPG Key ID: 49524C6F9F638F1A
106 changed files with 702 additions and 175 deletions

View File

@ -3,7 +3,7 @@
package events package events
import ( import (
typeurl "github.com/containerd/typeurl" v2 "github.com/containerd/typeurl/v2"
strings "strings" strings "strings"
) )
@ -43,7 +43,7 @@ func (m *ContainerCreate_Runtime) Field(fieldpath []string) (string, bool) {
case "name": case "name":
return string(m.Name), len(m.Name) > 0 return string(m.Name), len(m.Name) > 0
case "options": case "options":
decoded, err := typeurl.UnmarshalAny(m.Options) decoded, err := v2.UnmarshalAny(m.Options)
if err != nil { if err != nil {
return "", false return "", false
} }

View File

@ -3,7 +3,7 @@
package events package events
import ( import (
typeurl "github.com/containerd/typeurl" v2 "github.com/containerd/typeurl/v2"
) )
// Field returns the value for the given fieldpath as a string, if defined. // Field returns the value for the given fieldpath as a string, if defined.
@ -41,7 +41,7 @@ func (m *Envelope) Field(fieldpath []string) (string, bool) {
case "topic": case "topic":
return string(m.Topic), len(m.Topic) > 0 return string(m.Topic), len(m.Topic) > 0
case "event": case "event":
decoded, err := typeurl.UnmarshalAny(m.Event) decoded, err := v2.UnmarshalAny(m.Event)
if err != nil { if err != nil {
return "", false return "", false
} }

View File

@ -61,7 +61,7 @@ import (
"github.com/containerd/containerd/services/introspection" "github.com/containerd/containerd/services/introspection"
"github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots"
snproxy "github.com/containerd/containerd/snapshots/proxy" snproxy "github.com/containerd/containerd/snapshots/proxy"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"golang.org/x/sync/semaphore" "golang.org/x/sync/semaphore"

View File

@ -22,7 +22,7 @@ import (
"github.com/containerd/containerd" "github.com/containerd/containerd"
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
func init() { func init() {

View File

@ -30,7 +30,7 @@ import (
"github.com/containerd/containerd/containers" "github.com/containerd/containerd/containers"
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/urfave/cli" "github.com/urfave/cli"
) )

View File

@ -23,7 +23,7 @@ import (
"github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/cmd/ctr/commands"
"github.com/containerd/containerd/events" "github.com/containerd/containerd/events"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/urfave/cli" "github.com/urfave/cli"
// Register grpc event types // Register grpc event types

View File

@ -34,7 +34,7 @@ import (
ptypes "github.com/containerd/containerd/protobuf/types" ptypes "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/containerd/runtime/v2/shim"
"github.com/containerd/ttrpc" "github.com/containerd/ttrpc"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/urfave/cli" "github.com/urfave/cli"

View File

@ -24,7 +24,7 @@ import (
"github.com/containerd/containerd" "github.com/containerd/containerd"
"github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/cmd/ctr/commands"
gocni "github.com/containerd/go-cni" gocni "github.com/containerd/go-cni"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/moby/sys/signal" "github.com/moby/sys/signal"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/urfave/cli" "github.com/urfave/cli"

View File

@ -28,7 +28,7 @@ import (
v2 "github.com/containerd/cgroups/v3/cgroup2/stats" v2 "github.com/containerd/cgroups/v3/cgroup2/stats"
"github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/cmd/ctr/commands"
"github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/protobuf/proto"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/urfave/cli" "github.com/urfave/cli"
) )

View File

@ -23,7 +23,7 @@ import (
"text/tabwriter" "text/tabwriter"
"github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/cmd/ctr/commands"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/urfave/cli" "github.com/urfave/cli"
) )

View File

@ -82,7 +82,7 @@ func (gen *generator) genFieldMethod(m *protogen.Message) {
p.P("return value, ok") p.P("return value, ok")
case isAnyField(f): case isAnyField(f):
typeurlUnmarshalAny := gen.out.QualifiedGoIdent(protogen.GoIdent{ typeurlUnmarshalAny := gen.out.QualifiedGoIdent(protogen.GoIdent{
GoImportPath: "github.com/containerd/typeurl", GoImportPath: "github.com/containerd/typeurl/v2",
GoName: "UnmarshalAny", GoName: "UnmarshalAny",
}) })

View File

@ -35,7 +35,7 @@ import (
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/fifo" "github.com/containerd/fifo"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
ver "github.com/opencontainers/image-spec/specs-go" ver "github.com/opencontainers/image-spec/specs-go"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/opencontainers/selinux/go-selinux/label" "github.com/opencontainers/selinux/go-selinux/label"

View File

@ -30,7 +30,7 @@ import (
"github.com/containerd/containerd/oci" "github.com/containerd/containerd/oci"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/opencontainers/image-spec/identity" "github.com/opencontainers/image-spec/identity"
v1 "github.com/opencontainers/image-spec/specs-go/v1" v1 "github.com/opencontainers/image-spec/specs-go/v1"
) )

View File

@ -20,7 +20,7 @@ import (
"context" "context"
"time" "time"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
// Container represents the set of data pinned by a container. Unless otherwise // Container represents the set of data pinned by a container. Unless otherwise

View File

@ -26,7 +26,7 @@ import (
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
ptypes "github.com/containerd/containerd/protobuf/types" ptypes "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )

View File

@ -22,7 +22,7 @@ import (
"time" "time"
"github.com/containerd/containerd/mount" "github.com/containerd/containerd/mount"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
) )

View File

@ -24,7 +24,7 @@ import (
"github.com/containerd/containerd/archive/compression" "github.com/containerd/containerd/archive/compression"
"github.com/containerd/containerd/images" "github.com/containerd/containerd/images"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
) )

View File

@ -29,7 +29,7 @@ import (
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/protobuf/proto"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
exec "golang.org/x/sys/execabs" exec "golang.org/x/sys/execabs"
) )

View File

@ -29,7 +29,7 @@ import (
winio "github.com/Microsoft/go-winio" winio "github.com/Microsoft/go-winio"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/protobuf/proto"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
exec "golang.org/x/sys/execabs" exec "golang.org/x/sys/execabs"
) )

Binary file not shown.

View File

@ -23,7 +23,7 @@ import (
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/events" "github.com/containerd/containerd/events"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
// EventService handles the publish, forward and subscribe of events. // EventService handles the publish, forward and subscribe of events.

View File

@ -20,7 +20,7 @@ import (
"context" "context"
"time" "time"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
// Envelope provides the packaging for an event. // Envelope provides the packaging for an event.

View File

@ -28,7 +28,7 @@ import (
"github.com/containerd/containerd/identifiers" "github.com/containerd/containerd/identifiers"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
goevents "github.com/docker/go-events" goevents "github.com/docker/go-events"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )

View File

@ -27,7 +27,7 @@ import (
"github.com/containerd/containerd/events" "github.com/containerd/containerd/events"
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
) )

3
go.mod
View File

@ -19,7 +19,7 @@ require (
github.com/containerd/imgcrypt v1.1.5-0.20220421044638-8ba028dca028 github.com/containerd/imgcrypt v1.1.5-0.20220421044638-8ba028dca028
github.com/containerd/nri v0.2.1-0.20230131001841-b3cabdec0657 github.com/containerd/nri v0.2.1-0.20230131001841-b3cabdec0657
github.com/containerd/ttrpc v1.1.1-0.20230127163717-32fab2374638 github.com/containerd/ttrpc v1.1.1-0.20230127163717-32fab2374638
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67 github.com/containerd/typeurl/v2 v2.1.0
github.com/containerd/zfs v1.0.0 github.com/containerd/zfs v1.0.0
github.com/containernetworking/cni v1.1.2 github.com/containernetworking/cni v1.1.2
github.com/containernetworking/plugins v1.2.0 github.com/containernetworking/plugins v1.2.0
@ -89,6 +89,7 @@ require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cilium/ebpf v0.9.1 // indirect github.com/cilium/ebpf v0.9.1 // indirect
github.com/containerd/cgroups v1.1.0 // indirect github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/typeurl v1.0.2 // indirect
github.com/containers/ocicrypt v1.1.3 // indirect github.com/containers/ocicrypt v1.1.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect github.com/cyphar/filepath-securejoin v0.2.3 // indirect

5
go.sum
View File

@ -277,9 +277,10 @@ github.com/containerd/ttrpc v1.1.1-0.20230127163717-32fab2374638/go.mod h1:YYyNV
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk=
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY=
github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s=
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67 h1:rQvjv7gRi6Ki/NS/U9oLZFhqyk4dh/GH2M3o/4BRkMM= github.com/containerd/typeurl/v2 v2.1.0 h1:yNAhJvbNEANt7ck48IlEGOxP7YAp6LLpGn5jZACDNIE=
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67/go.mod h1:HDkcKOXRnX6yKnXv3P0QrogFi0DoiauK/LpQi961f0A= github.com/containerd/typeurl/v2 v2.1.0/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0=
github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw=
github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y=
github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY=

View File

@ -44,7 +44,7 @@ import (
_ "github.com/containerd/containerd/runtime" _ "github.com/containerd/containerd/runtime"
"github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/go-runc" "github.com/containerd/go-runc"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
specs "github.com/opencontainers/runtime-spec/specs-go" specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
exec "golang.org/x/sys/execabs" exec "golang.org/x/sys/execabs"

View File

@ -10,7 +10,7 @@ require (
github.com/containerd/containerd v1.7.0-beta.0 // see replace; the actual version of containerd is replaced with the code at the root of this repository github.com/containerd/containerd v1.7.0-beta.0 // see replace; the actual version of containerd is replaced with the code at the root of this repository
github.com/containerd/go-runc v1.0.0 github.com/containerd/go-runc v1.0.0
github.com/containerd/ttrpc v1.1.1-0.20230127163717-32fab2374638 github.com/containerd/ttrpc v1.1.1-0.20230127163717-32fab2374638
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67 github.com/containerd/typeurl/v2 v2.1.0
github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b
github.com/opencontainers/runtime-spec v1.0.3-0.20220825212826-86290f6a00fb github.com/opencontainers/runtime-spec v1.0.3-0.20220825212826-86290f6a00fb

View File

@ -530,8 +530,8 @@ github.com/containerd/ttrpc v1.1.1-0.20230127163717-32fab2374638 h1:8eVDsirmav+3
github.com/containerd/ttrpc v1.1.1-0.20230127163717-32fab2374638/go.mod h1:YYyNVhZrTMiaf51Vj6WhAJqJw+vl/nzABhj8pWrzle4= github.com/containerd/ttrpc v1.1.1-0.20230127163717-32fab2374638/go.mod h1:YYyNVhZrTMiaf51Vj6WhAJqJw+vl/nzABhj8pWrzle4=
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s=
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67 h1:rQvjv7gRi6Ki/NS/U9oLZFhqyk4dh/GH2M3o/4BRkMM= github.com/containerd/typeurl/v2 v2.1.0 h1:yNAhJvbNEANt7ck48IlEGOxP7YAp6LLpGn5jZACDNIE=
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67/go.mod h1:HDkcKOXRnX6yKnXv3P0QrogFi0DoiauK/LpQi961f0A= github.com/containerd/typeurl/v2 v2.1.0/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0=
github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY=
github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y=
github.com/containernetworking/cni v1.1.1/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= github.com/containernetworking/cni v1.1.1/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw=

View File

@ -36,7 +36,7 @@ import (
"github.com/containerd/containerd/pkg/testutil" "github.com/containerd/containerd/pkg/testutil"
"github.com/containerd/containerd/runtime/restart" "github.com/containerd/containerd/runtime/restart"
srvconfig "github.com/containerd/containerd/services/server/config" srvconfig "github.com/containerd/containerd/services/server/config"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
exec "golang.org/x/sys/execabs" exec "golang.org/x/sys/execabs"
) )

View File

@ -39,7 +39,7 @@ import (
"github.com/containerd/containerd/pkg/cri/sbserver/podsandbox" "github.com/containerd/containerd/pkg/cri/sbserver/podsandbox"
"github.com/containerd/containerd/pkg/cri/store/sandbox" "github.com/containerd/containerd/pkg/cri/store/sandbox"
"github.com/containerd/containerd/pkg/failpoint" "github.com/containerd/containerd/pkg/failpoint"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
const ( const (

View File

@ -23,7 +23,7 @@ import (
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/protobuf/proto"
"github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
bolt "go.etcd.io/bbolt" bolt "go.etcd.io/bbolt"
) )

View File

@ -21,7 +21,7 @@ import (
"reflect" "reflect"
"time" "time"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
) )

View File

@ -32,7 +32,7 @@ import (
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/protobuf/proto"
"github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
bolt "go.etcd.io/bbolt" bolt "go.etcd.io/bbolt"
) )

View File

@ -32,7 +32,7 @@ import (
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"

View File

@ -29,7 +29,7 @@ import (
"github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/metadata/boltutil"
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
api "github.com/containerd/containerd/sandbox" api "github.com/containerd/containerd/sandbox"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"go.etcd.io/bbolt" "go.etcd.io/bbolt"
) )

View File

@ -22,7 +22,7 @@ import (
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/protobuf/types"
api "github.com/containerd/containerd/sandbox" api "github.com/containerd/containerd/sandbox"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
) )

View File

@ -30,7 +30,7 @@ import (
v1 "github.com/containerd/containerd/metrics/types/v1" v1 "github.com/containerd/containerd/metrics/types/v1"
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/pkg/timeout" "github.com/containerd/containerd/pkg/timeout"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/docker/go-metrics" "github.com/docker/go-metrics"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
) )

View File

@ -29,7 +29,7 @@ import (
v2 "github.com/containerd/containerd/metrics/types/v2" v2 "github.com/containerd/containerd/metrics/types/v2"
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/pkg/timeout" "github.com/containerd/containerd/pkg/timeout"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/docker/go-metrics" "github.com/docker/go-metrics"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
) )

View File

@ -24,7 +24,7 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
imagespec "github.com/opencontainers/image-spec/specs-go/v1" imagespec "github.com/opencontainers/image-spec/specs-go/v1"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"

View File

@ -24,7 +24,7 @@ import (
v1 "github.com/containerd/containerd/metrics/types/v1" v1 "github.com/containerd/containerd/metrics/types/v1"
v2 "github.com/containerd/containerd/metrics/types/v2" v2 "github.com/containerd/containerd/metrics/types/v2"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
containerstore "github.com/containerd/containerd/pkg/cri/store/container" containerstore "github.com/containerd/containerd/pkg/cri/store/container"

View File

@ -22,7 +22,7 @@ import (
wstats "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats" wstats "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats"
"github.com/containerd/containerd/api/types" "github.com/containerd/containerd/api/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
containerstore "github.com/containerd/containerd/pkg/cri/store/container" containerstore "github.com/containerd/containerd/pkg/cri/store/container"

View File

@ -23,7 +23,7 @@ import (
gocontext "context" gocontext "context"
"fmt" "fmt"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

View File

@ -33,7 +33,7 @@ import (
sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox"
ctrdutil "github.com/containerd/containerd/pkg/cri/util" ctrdutil "github.com/containerd/containerd/pkg/cri/util"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/utils/clock" "k8s.io/utils/clock"

View File

@ -22,7 +22,7 @@ import (
eventtypes "github.com/containerd/containerd/api/events" eventtypes "github.com/containerd/containerd/api/events"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
testingclock "k8s.io/utils/clock/testing" testingclock "k8s.io/utils/clock/testing"

View File

@ -27,7 +27,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View File

@ -34,7 +34,7 @@ import (
"github.com/containerd/containerd/reference/docker" "github.com/containerd/containerd/reference/docker"
"github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/linux/runctypes"
runcoptions "github.com/containerd/containerd/runtime/v2/runc/options" runcoptions "github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
imagedigest "github.com/opencontainers/go-digest" imagedigest "github.com/opencontainers/go-digest"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"

View File

@ -23,7 +23,7 @@ import (
"github.com/containerd/nri" "github.com/containerd/nri"
v1 "github.com/containerd/nri/types/v1" v1 "github.com/containerd/nri/types/v1"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
"github.com/hashicorp/go-multierror" "github.com/hashicorp/go-multierror"
"github.com/opencontainers/selinux/go-selinux" "github.com/opencontainers/selinux/go-selinux"

View File

@ -20,7 +20,7 @@ import (
goruntime "runtime" goruntime "runtime"
"testing" "testing"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
imagespec "github.com/opencontainers/image-spec/specs-go/v1" imagespec "github.com/opencontainers/image-spec/specs-go/v1"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"

View File

@ -27,7 +27,7 @@ import (
sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox"
"github.com/containerd/containerd/sandbox" "github.com/containerd/containerd/sandbox"
"github.com/containerd/go-cni" "github.com/containerd/go-cni"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
) )

View File

@ -32,7 +32,7 @@ import (
criconfig "github.com/containerd/containerd/pkg/cri/config" criconfig "github.com/containerd/containerd/pkg/cri/config"
"github.com/containerd/containerd/pkg/cri/sbserver/podsandbox" "github.com/containerd/containerd/pkg/cri/sbserver/podsandbox"
"github.com/containerd/containerd/platforms" "github.com/containerd/containerd/platforms"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

View File

@ -27,7 +27,7 @@ import (
"time" "time"
"github.com/containerd/go-cni" "github.com/containerd/go-cni"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/hashicorp/go-multierror" "github.com/hashicorp/go-multierror"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

View File

@ -23,7 +23,7 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
imagespec "github.com/opencontainers/image-spec/specs-go/v1" imagespec "github.com/opencontainers/image-spec/specs-go/v1"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"

View File

@ -24,7 +24,7 @@ import (
v1 "github.com/containerd/containerd/metrics/types/v1" v1 "github.com/containerd/containerd/metrics/types/v1"
v2 "github.com/containerd/containerd/metrics/types/v2" v2 "github.com/containerd/containerd/metrics/types/v2"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
containerstore "github.com/containerd/containerd/pkg/cri/store/container" containerstore "github.com/containerd/containerd/pkg/cri/store/container"

View File

@ -22,7 +22,7 @@ import (
wstats "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats" wstats "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats"
"github.com/containerd/containerd/api/types" "github.com/containerd/containerd/api/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
containerstore "github.com/containerd/containerd/pkg/cri/store/container" containerstore "github.com/containerd/containerd/pkg/cri/store/container"

View File

@ -27,7 +27,7 @@ import (
"github.com/containerd/containerd/containers" "github.com/containerd/containerd/containers"
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

View File

@ -33,7 +33,7 @@ import (
sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox" sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox"
ctrdutil "github.com/containerd/containerd/pkg/cri/util" ctrdutil "github.com/containerd/containerd/pkg/cri/util"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/utils/clock" "k8s.io/utils/clock"

View File

@ -22,7 +22,7 @@ import (
eventtypes "github.com/containerd/containerd/api/events" eventtypes "github.com/containerd/containerd/api/events"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
testingclock "k8s.io/utils/clock/testing" testingclock "k8s.io/utils/clock/testing"

View File

@ -39,7 +39,7 @@ import (
"github.com/containerd/containerd/reference/docker" "github.com/containerd/containerd/reference/docker"
"github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/linux/runctypes"
runcoptions "github.com/containerd/containerd/runtime/v2/runc/options" runcoptions "github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View File

@ -34,7 +34,7 @@ import (
"github.com/containerd/containerd/reference/docker" "github.com/containerd/containerd/reference/docker"
"github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/linux/runctypes"
runcoptions "github.com/containerd/containerd/runtime/v2/runc/options" runcoptions "github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
imagedigest "github.com/opencontainers/go-digest" imagedigest "github.com/opencontainers/go-digest"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"

View File

@ -31,7 +31,7 @@ import (
cstore "github.com/containerd/containerd/pkg/cri/store/container" cstore "github.com/containerd/containerd/pkg/cri/store/container"
sstore "github.com/containerd/containerd/pkg/cri/store/sandbox" sstore "github.com/containerd/containerd/pkg/cri/store/sandbox"
ctrdutil "github.com/containerd/containerd/pkg/cri/util" ctrdutil "github.com/containerd/containerd/pkg/cri/util"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/generate" "github.com/opencontainers/runtime-tools/generate"

View File

@ -30,7 +30,7 @@ import (
containerdimages "github.com/containerd/containerd/images" containerdimages "github.com/containerd/containerd/images"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/containerd/platforms" "github.com/containerd/containerd/platforms"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

View File

@ -28,7 +28,7 @@ import (
"time" "time"
cni "github.com/containerd/go-cni" cni "github.com/containerd/go-cni"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
selinux "github.com/opencontainers/selinux/go-selinux" selinux "github.com/opencontainers/selinux/go-selinux"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View File

@ -23,7 +23,7 @@ import (
"testing" "testing"
cni "github.com/containerd/go-cni" cni "github.com/containerd/go-cni"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
imagespec "github.com/opencontainers/image-spec/specs-go/v1" imagespec "github.com/opencontainers/image-spec/specs-go/v1"
runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"

View File

@ -19,7 +19,7 @@ package streaming
import ( import (
"context" "context"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
type StreamManager interface { type StreamManager interface {

View File

@ -25,7 +25,7 @@ import (
"github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/streaming"
"github.com/containerd/containerd/pkg/transfer/plugins" "github.com/containerd/containerd/pkg/transfer/plugins"
tstreaming "github.com/containerd/containerd/pkg/transfer/streaming" tstreaming "github.com/containerd/containerd/pkg/transfer/streaming"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
func init() { func init() {

View File

@ -26,7 +26,7 @@ import (
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/streaming"
tstreaming "github.com/containerd/containerd/pkg/transfer/streaming" tstreaming "github.com/containerd/containerd/pkg/transfer/streaming"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
) )

View File

@ -31,7 +31,7 @@ import (
"github.com/containerd/containerd/pkg/unpack" "github.com/containerd/containerd/pkg/unpack"
"github.com/containerd/containerd/platforms" "github.com/containerd/containerd/platforms"
"github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
) )

View File

@ -33,7 +33,7 @@ import (
tstreaming "github.com/containerd/containerd/pkg/transfer/streaming" tstreaming "github.com/containerd/containerd/pkg/transfer/streaming"
"github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes"
"github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
) )

View File

@ -27,7 +27,7 @@ import (
"github.com/containerd/containerd/images" "github.com/containerd/containerd/images"
"github.com/containerd/containerd/leases" "github.com/containerd/containerd/leases"
"github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/transfer"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"golang.org/x/sync/semaphore" "golang.org/x/sync/semaphore"
) )

View File

@ -22,7 +22,7 @@ import (
"sync" "sync"
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
var register = struct { var register = struct {

View File

@ -27,7 +27,7 @@ import (
"github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/streaming"
"github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/transfer"
tstreaming "github.com/containerd/containerd/pkg/transfer/streaming" tstreaming "github.com/containerd/containerd/pkg/transfer/streaming"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/anypb"
) )

View File

@ -29,7 +29,7 @@ import (
transferapi "github.com/containerd/containerd/api/types/transfer" transferapi "github.com/containerd/containerd/api/types/transfer"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/streaming"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
const maxRead = 32 * 1024 const maxRead = 32 * 1024

View File

@ -23,7 +23,7 @@ import (
"testing" "testing"
"github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/streaming"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
func FuzzSendAndReceive(f *testing.F) { func FuzzSendAndReceive(f *testing.F) {

View File

@ -25,7 +25,7 @@ import (
transferapi "github.com/containerd/containerd/api/types/transfer" transferapi "github.com/containerd/containerd/api/types/transfer"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/streaming"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
func WriteByteStream(ctx context.Context, stream streaming.Stream) io.WriteCloser { func WriteByteStream(ctx context.Context, stream streaming.Stream) io.WriteCloser {

View File

@ -17,7 +17,7 @@
package protobuf package protobuf
import ( import (
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/anypb"
) )

View File

@ -21,7 +21,7 @@ import (
"time" "time"
"github.com/containerd/containerd/mount" "github.com/containerd/containerd/mount"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
// IO holds process IO information // IO holds process IO information

View File

@ -19,7 +19,7 @@ package runtime
import ( import (
"strconv" "strconv"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
specs "github.com/opencontainers/runtime-spec/specs-go" specs "github.com/opencontainers/runtime-spec/specs-go"
) )

View File

@ -48,7 +48,7 @@ import (
v1 "github.com/containerd/containerd/runtime/v1" v1 "github.com/containerd/containerd/runtime/v1"
"github.com/containerd/containerd/runtime/v1/shim/v1" "github.com/containerd/containerd/runtime/v1/shim/v1"
"github.com/containerd/go-runc" "github.com/containerd/go-runc"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"

View File

@ -43,7 +43,7 @@ import (
shimapi "github.com/containerd/containerd/runtime/v1/shim/v1" shimapi "github.com/containerd/containerd/runtime/v1/shim/v1"
"github.com/containerd/containerd/sys/reaper" "github.com/containerd/containerd/sys/reaper"
runc "github.com/containerd/go-runc" runc "github.com/containerd/go-runc"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
specs "github.com/opencontainers/runtime-spec/specs-go" specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"

View File

@ -26,7 +26,7 @@ import (
"github.com/containerd/containerd/identifiers" "github.com/containerd/containerd/identifiers"
"github.com/containerd/containerd/mount" "github.com/containerd/containerd/mount"
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
) )

View File

@ -29,7 +29,7 @@ import (
"github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/oci" "github.com/containerd/containerd/oci"
"github.com/containerd/containerd/pkg/testutil" "github.com/containerd/containerd/pkg/testutil"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"

View File

@ -37,7 +37,7 @@ import (
"github.com/containerd/containerd/pkg/process" "github.com/containerd/containerd/pkg/process"
"github.com/containerd/containerd/pkg/stdio" "github.com/containerd/containerd/pkg/stdio"
"github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )

View File

@ -47,7 +47,7 @@ import (
"github.com/containerd/containerd/sys/reaper" "github.com/containerd/containerd/sys/reaper"
runcC "github.com/containerd/go-runc" runcC "github.com/containerd/go-runc"
"github.com/containerd/ttrpc" "github.com/containerd/ttrpc"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )

View File

@ -49,7 +49,7 @@ import (
"github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/containerd/runtime/v2/shim"
"github.com/containerd/containerd/sys/reaper" "github.com/containerd/containerd/sys/reaper"
runcC "github.com/containerd/go-runc" runcC "github.com/containerd/go-runc"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
exec "golang.org/x/sys/execabs" exec "golang.org/x/sys/execabs"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"

View File

@ -33,7 +33,7 @@ import (
"github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/protobuf/proto"
"github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/ttrpc" "github.com/containerd/ttrpc"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
exec "golang.org/x/sys/execabs" exec "golang.org/x/sys/execabs"
) )

View File

@ -26,7 +26,7 @@ import (
"github.com/containerd/containerd/oci" "github.com/containerd/containerd/oci"
"github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/protobuf/types"
api "github.com/containerd/containerd/sandbox" api "github.com/containerd/containerd/sandbox"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
// Sandbox is a high level client to containerd's sandboxes. // Sandbox is a high level client to containerd's sandboxes.

View File

@ -22,7 +22,7 @@ import (
"github.com/containerd/containerd/api/types" "github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/platforms" "github.com/containerd/containerd/platforms"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
type CreateOptions struct { type CreateOptions struct {

View File

@ -20,7 +20,7 @@ import (
"github.com/containerd/containerd/api/types" "github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
gogo_types "github.com/containerd/containerd/protobuf/types" gogo_types "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
// ToProto will map Sandbox struct to it's protobuf definition // ToProto will map Sandbox struct to it's protobuf definition

View File

@ -22,7 +22,7 @@ import (
"time" "time"
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
// Sandbox is an object stored in metadata database // Sandbox is an object stored in metadata database

View File

@ -19,7 +19,7 @@ package sandbox
import ( import (
"testing" "testing"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -21,7 +21,7 @@ import (
"github.com/containerd/containerd/containers" "github.com/containerd/containerd/containers"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
func containersToProto(containers []containers.Container) []*api.Container { func containersToProto(containers []containers.Container) []*api.Container {

View File

@ -27,7 +27,7 @@ import (
"github.com/containerd/containerd/mount" "github.com/containerd/containerd/mount"
"github.com/containerd/containerd/plugin" "github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/services" "github.com/containerd/containerd/services"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/opencontainers/go-digest" "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"google.golang.org/grpc" "google.golang.org/grpc"

View File

@ -27,7 +27,7 @@ import (
"github.com/containerd/containerd/plugin" "github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
ptypes "github.com/containerd/containerd/protobuf/types" ptypes "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"google.golang.org/grpc" "google.golang.org/grpc"
) )

View File

@ -48,7 +48,7 @@ import (
"github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/linux/runctypes"
"github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/containerd/services" "github.com/containerd/containerd/services"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"github.com/opencontainers/go-digest" "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"google.golang.org/grpc" "google.golang.org/grpc"

View File

@ -28,7 +28,7 @@ import (
"github.com/containerd/containerd/pkg/transfer/plugins" "github.com/containerd/containerd/pkg/transfer/plugins"
"github.com/containerd/containerd/plugin" "github.com/containerd/containerd/plugin"
ptypes "github.com/containerd/containerd/protobuf/types" ptypes "github.com/containerd/containerd/protobuf/types"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"

View File

@ -43,7 +43,7 @@ import (
"github.com/containerd/containerd/rootfs" "github.com/containerd/containerd/rootfs"
"github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/linux/runctypes"
"github.com/containerd/containerd/runtime/v2/runc/options" "github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
digest "github.com/opencontainers/go-digest" digest "github.com/opencontainers/go-digest"
is "github.com/opencontainers/image-spec/specs-go" is "github.com/opencontainers/image-spec/specs-go"
v1 "github.com/opencontainers/image-spec/specs-go/v1" v1 "github.com/opencontainers/image-spec/specs-go/v1"

View File

@ -28,7 +28,7 @@ import (
"github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/transfer"
"github.com/containerd/containerd/pkg/transfer/proxy" "github.com/containerd/containerd/pkg/transfer/proxy"
"github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl" "github.com/containerd/typeurl/v2"
) )
func (c *Client) Transfer(ctx context.Context, src interface{}, dest interface{}, opts ...transfer.Opt) error { func (c *Client) Transfer(ctx context.Context, src interface{}, dest interface{}, opts ...transfer.Opt) error {

View File

@ -7,7 +7,7 @@
A Go package for managing the registration, marshaling, and unmarshaling of encoded types. A Go package for managing the registration, marshaling, and unmarshaling of encoded types.
This package helps when types are sent over a ttrpc/GRPC API and marshaled as a protobuf [Any](https://pkg.go.dev/google.golang.org/protobuf@v1.27.1/types/known/anypb#Any) This package helps when types are sent over a GRPC API and marshaled as a [protobuf.Any](https://github.com/gogo/protobuf/blob/master/protobuf/google/protobuf/any.proto).
## Project details ## Project details

View File

@ -18,15 +18,13 @@ package typeurl
import ( import (
"encoding/json" "encoding/json"
"errors"
"fmt"
"path" "path"
"reflect" "reflect"
"sync" "sync"
gogoproto "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/proto"
"google.golang.org/protobuf/proto" "github.com/gogo/protobuf/types"
"google.golang.org/protobuf/reflect/protoregistry" "github.com/pkg/errors"
) )
var ( var (
@ -41,35 +39,10 @@ var (
// //
// To detect an error class, use errors.Is() functions to tell whether an // To detect an error class, use errors.Is() functions to tell whether an
// error is of this type. // error is of this type.
var ( var (
ErrNotFound = errors.New("not found") ErrNotFound = errors.New("not found")
) )
type Any interface {
GetTypeUrl() string
GetValue() []byte
}
type any struct {
typeURL string
value []byte
}
func (a *any) GetTypeUrl() string {
if a == nil {
return ""
}
return a.typeURL
}
func (a *any) GetValue() []byte {
if a == nil {
return nil
}
return a.value
}
// Register a type with a base URL for JSON marshaling. When the MarshalAny and // Register a type with a base URL for JSON marshaling. When the MarshalAny and
// UnmarshalAny functions are called they will treat the Any type value as JSON. // UnmarshalAny functions are called they will treat the Any type value as JSON.
// To use protocol buffers for handling the Any value the proto.Register // To use protocol buffers for handling the Any value the proto.Register
@ -83,7 +56,7 @@ func Register(v interface{}, args ...string) {
defer mu.Unlock() defer mu.Unlock()
if et, ok := registry[t]; ok { if et, ok := registry[t]; ok {
if et != p { if et != p {
panic(fmt.Errorf("type registered with alternate path %q != %q", et, p)) panic(errors.Errorf("type registered with alternate path %q != %q", et, p))
} }
return return
} }
@ -96,47 +69,41 @@ func TypeURL(v interface{}) (string, error) {
u, ok := registry[tryDereference(v)] u, ok := registry[tryDereference(v)]
mu.RUnlock() mu.RUnlock()
if !ok { if !ok {
switch t := v.(type) { // fallback to the proto registry if it is a proto message
case proto.Message: pb, ok := v.(proto.Message)
return string(t.ProtoReflect().Descriptor().FullName()), nil if !ok {
case gogoproto.Message: return "", errors.Wrapf(ErrNotFound, "type %s", reflect.TypeOf(v))
return gogoproto.MessageName(t), nil
default:
return "", fmt.Errorf("type %s: %w", reflect.TypeOf(v), ErrNotFound)
} }
return proto.MessageName(pb), nil
} }
return u, nil return u, nil
} }
// Is returns true if the type of the Any is the same as v. // Is returns true if the type of the Any is the same as v.
func Is(any Any, v interface{}) bool { func Is(any *types.Any, v interface{}) bool {
// call to check that v is a pointer // call to check that v is a pointer
tryDereference(v) tryDereference(v)
url, err := TypeURL(v) url, err := TypeURL(v)
if err != nil { if err != nil {
return false return false
} }
return any.GetTypeUrl() == url return any.TypeUrl == url
} }
// MarshalAny marshals the value v into an any with the correct TypeUrl. // MarshalAny marshals the value v into an any with the correct TypeUrl.
// If the provided object is already a proto.Any message, then it will be // If the provided object is already a proto.Any message, then it will be
// returned verbatim. If it is of type proto.Message, it will be marshaled as a // returned verbatim. If it is of type proto.Message, it will be marshaled as a
// protocol buffer. Otherwise, the object will be marshaled to json. // protocol buffer. Otherwise, the object will be marshaled to json.
func MarshalAny(v interface{}) (Any, error) { func MarshalAny(v interface{}) (*types.Any, error) {
var marshal func(v interface{}) ([]byte, error) var marshal func(v interface{}) ([]byte, error)
switch t := v.(type) { switch t := v.(type) {
case Any: case *types.Any:
// avoid reserializing the type if we have an any. // avoid reserializing the type if we have an any.
return t, nil return t, nil
case proto.Message: case proto.Message:
marshal = func(v interface{}) ([]byte, error) { marshal = func(v interface{}) ([]byte, error) {
return proto.Marshal(t) return proto.Marshal(t)
} }
case gogoproto.Message:
marshal = func(v interface{}) ([]byte, error) {
return gogoproto.Marshal(t)
}
default: default:
marshal = json.Marshal marshal = json.Marshal
} }
@ -150,15 +117,15 @@ func MarshalAny(v interface{}) (Any, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &any{ return &types.Any{
typeURL: url, TypeUrl: url,
value: data, Value: data,
}, nil }, nil
} }
// UnmarshalAny unmarshals the any type into a concrete type. // UnmarshalAny unmarshals the any type into a concrete type.
func UnmarshalAny(any Any) (interface{}, error) { func UnmarshalAny(any *types.Any) (interface{}, error) {
return UnmarshalByTypeURL(any.GetTypeUrl(), any.GetValue()) return UnmarshalByTypeURL(any.TypeUrl, any.Value)
} }
// UnmarshalByTypeURL unmarshals the given type and value to into a concrete type. // UnmarshalByTypeURL unmarshals the given type and value to into a concrete type.
@ -169,11 +136,11 @@ func UnmarshalByTypeURL(typeURL string, value []byte) (interface{}, error) {
// UnmarshalTo unmarshals the any type into a concrete type passed in the out // UnmarshalTo unmarshals the any type into a concrete type passed in the out
// argument. It is identical to UnmarshalAny, but lets clients provide a // argument. It is identical to UnmarshalAny, but lets clients provide a
// destination type through the out argument. // destination type through the out argument.
func UnmarshalTo(any Any, out interface{}) error { func UnmarshalTo(any *types.Any, out interface{}) error {
return UnmarshalToByTypeURL(any.GetTypeUrl(), any.GetValue(), out) return UnmarshalToByTypeURL(any.TypeUrl, any.Value, out)
} }
// UnmarshalToByTypeURL unmarshals the given type and value into a concrete type passed // UnmarshalTo unmarshals the given type and value into a concrete type passed
// in the out argument. It is identical to UnmarshalByTypeURL, but lets clients // in the out argument. It is identical to UnmarshalByTypeURL, but lets clients
// provide a destination type through the out argument. // provide a destination type through the out argument.
func UnmarshalToByTypeURL(typeURL string, value []byte, out interface{}) error { func UnmarshalToByTypeURL(typeURL string, value []byte, out interface{}) error {
@ -182,10 +149,6 @@ func UnmarshalToByTypeURL(typeURL string, value []byte, out interface{}) error {
} }
func unmarshal(typeURL string, value []byte, v interface{}) (interface{}, error) { func unmarshal(typeURL string, value []byte, v interface{}) (interface{}, error) {
if value == nil {
return nil, nil
}
t, err := getTypeByUrl(typeURL) t, err := getTypeByUrl(typeURL)
if err != nil { if err != nil {
return nil, err return nil, err
@ -200,17 +163,12 @@ func unmarshal(typeURL string, value []byte, v interface{}) (interface{}, error)
return nil, err return nil, err
} }
if typeURL != vURL { if typeURL != vURL {
return nil, fmt.Errorf("can't unmarshal type %q to output %q", typeURL, vURL) return nil, errors.Errorf("can't unmarshal type %q to output %q", typeURL, vURL)
} }
} }
if t.isProto { if t.isProto {
switch t := v.(type) { err = proto.Unmarshal(value, v.(proto.Message))
case proto.Message:
err = proto.Unmarshal(value, t)
case gogoproto.Message:
err = gogoproto.Unmarshal(value, t)
}
} else { } else {
err = json.Unmarshal(value, v) err = json.Unmarshal(value, v)
} }
@ -235,7 +193,7 @@ func getTypeByUrl(url string) (urlType, error) {
} }
mu.RUnlock() mu.RUnlock()
// fallback to proto registry // fallback to proto registry
t := gogoproto.MessageType(url) t := proto.MessageType(url)
if t != nil { if t != nil {
return urlType{ return urlType{
// get the underlying Elem because proto returns a pointer to the type // get the underlying Elem because proto returns a pointer to the type
@ -243,12 +201,7 @@ func getTypeByUrl(url string) (urlType, error) {
isProto: true, isProto: true,
}, nil }, nil
} }
mt, err := protoregistry.GlobalTypes.FindMessageByURL(url) return urlType{}, errors.Wrapf(ErrNotFound, "type with url %s", url)
if err != nil {
return urlType{}, fmt.Errorf("type with url %s: %w", url, ErrNotFound)
}
empty := mt.New().Interface()
return urlType{t: reflect.TypeOf(empty).Elem(), isProto: true}, nil
} }
func tryDereference(v interface{}) reflect.Type { func tryDereference(v interface{}) reflect.Type {

Some files were not shown because too many files have changed in this diff Show More