Use typeurl.Any instead of github.com/gogo/protobuf/types.Any

This commit upgrades github.com/containerd/typeurl to use typeurl.Any.
The interface hides gogo/protobuf/types.Any from containerd's Go client.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
Kazuyoshi Kato
2022-03-22 00:40:39 +00:00
parent 551516a18d
commit 96b16b447d
42 changed files with 336 additions and 152 deletions

View File

@@ -1440,11 +1440,11 @@ func TestContainerExtensions(t *testing.T) {
if len(cExts) != 1 {
t.Errorf("expected 1 container extension")
}
if cExts["hello"].TypeUrl != ext.TypeUrl {
t.Errorf("got unexpected type url for extension: %s", cExts["hello"].TypeUrl)
if actual := cExts["hello"].GetTypeUrl(); actual != ext.TypeUrl {
t.Errorf("got unexpected type url for extension: %s", actual)
}
if !bytes.Equal(cExts["hello"].Value, ext.Value) {
t.Errorf("expected extension value %q, got: %q", ext.Value, cExts["hello"].Value)
if actual := cExts["hello"].GetValue(); !bytes.Equal(actual, ext.Value) {
t.Errorf("expected extension value %q, got: %q", ext.Value, actual)
}
}

View File

@@ -10,7 +10,7 @@ require (
github.com/containerd/containerd v1.5.10
github.com/containerd/go-runc v1.0.0
github.com/containerd/ttrpc v1.1.0
github.com/containerd/typeurl v1.0.2
github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259
github.com/gogo/protobuf v1.3.2
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1

View File

@@ -152,8 +152,9 @@ github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8h
github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI=
github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ=
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.3-0.20220324183432-6193a0e03259 h1:bJv9qgjarrsdd4XIIczeRdYXON88Fgn3GdXVfnQjcSo=
github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259/go.mod h1:HDkcKOXRnX6yKnXv3P0QrogFi0DoiauK/LpQi961f0A=
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/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE=