From ff09b428e115c19100e3da706109ef3d1c48f3d9 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Mon, 4 Nov 2024 22:29:24 -0800 Subject: [PATCH] Update typeurl to v2.2.2 Fixes panic when typeurl is not found Signed-off-by: Derek McGowan --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/containerd/typeurl/v2/types.go | 14 ++++++-------- vendor/modules.txt | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index be7bcab7e..97172186a 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/containerd/platforms v1.0.0-rc.0 github.com/containerd/plugin v1.0.0 github.com/containerd/ttrpc v1.2.6 - github.com/containerd/typeurl/v2 v2.2.1 + github.com/containerd/typeurl/v2 v2.2.2 github.com/containerd/zfs/v2 v2.0.0-rc.0 github.com/containernetworking/cni v1.2.3 github.com/containernetworking/plugins v1.5.1 diff --git a/go.sum b/go.sum index d44a4184e..a52345b71 100644 --- a/go.sum +++ b/go.sum @@ -698,8 +698,8 @@ github.com/containerd/plugin v1.0.0/go.mod h1:hQfJe5nmWfImiqT1q8Si3jLv3ynMUIBB47 github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak= github.com/containerd/ttrpc v1.2.6 h1:zG+Kn5EZ6MUYCS1t2Hmt2J4tMVaLSFEJVOraDQwNPC4= github.com/containerd/ttrpc v1.2.6/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= -github.com/containerd/typeurl/v2 v2.2.1 h1:/X1Kgcz4sKS/NTKQvvRS0pEVpUYqmPTwGQontm9pl0w= -github.com/containerd/typeurl/v2 v2.2.1/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk= +github.com/containerd/typeurl/v2 v2.2.2 h1:3jN/k2ysKuPCsln5Qv8bzR9cxal8XjkxPogJfSNO31k= +github.com/containerd/typeurl/v2 v2.2.2/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk= github.com/containerd/zfs/v2 v2.0.0-rc.0 h1:0dRlgpoaepW7HuovtcvYQMF7NlpceQVdn7+3Udeth4M= github.com/containerd/zfs/v2 v2.0.0-rc.0/go.mod h1:g36g/XCEGDRxUXIFdM3oWAEvmTvhfz/eKWElqg4Secw= github.com/containernetworking/cni v1.2.3 h1:hhOcjNVUQTnzdRJ6alC5XF+wd9mfGIUaj8FuJbEslXM= diff --git a/vendor/github.com/containerd/typeurl/v2/types.go b/vendor/github.com/containerd/typeurl/v2/types.go index 156335b3c..efc405ddd 100644 --- a/vendor/github.com/containerd/typeurl/v2/types.go +++ b/vendor/github.com/containerd/typeurl/v2/types.go @@ -284,16 +284,14 @@ func getTypeByUrl(url string) (reflect.Type, error) { mu.RUnlock() mt, err := protoregistry.GlobalTypes.FindMessageByURL(url) if err != nil { - e := protoregistry.NotFound - if !errors.Is(err, e) { - return nil, fmt.Errorf("type with url %s: %w", url, ErrNotFound) - } - - for _, h := range handlers { - if t := h.GetType(url); t != nil { - return t, nil + if errors.Is(err, protoregistry.NotFound) { + for _, h := range handlers { + if t := h.GetType(url); t != nil { + return t, nil + } } } + return nil, fmt.Errorf("type with url %s: %w", url, ErrNotFound) } empty := mt.New().Interface() return reflect.TypeOf(empty).Elem(), nil diff --git a/vendor/modules.txt b/vendor/modules.txt index 8bef47877..b22f7d283 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -194,7 +194,7 @@ github.com/containerd/plugin/registry # github.com/containerd/ttrpc v1.2.6 ## explicit; go 1.19 github.com/containerd/ttrpc -# github.com/containerd/typeurl/v2 v2.2.1 +# github.com/containerd/typeurl/v2 v2.2.2 ## explicit; go 1.21 github.com/containerd/typeurl/v2 # github.com/containerd/zfs/v2 v2.0.0-rc.0