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

@@ -31,11 +31,11 @@ import (
"github.com/containerd/containerd/events/exchange"
"github.com/containerd/containerd/identifiers"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/protobuf"
"github.com/containerd/containerd/runtime"
"github.com/containerd/containerd/runtime/v1/shim/client"
"github.com/containerd/containerd/runtime/v1/shim/v1"
"github.com/containerd/ttrpc"
"github.com/containerd/typeurl"
"github.com/gogo/protobuf/types"
)
@@ -326,7 +326,7 @@ func (t *Task) Stats(ctx context.Context) (*types.Any, error) {
if err != nil {
return nil, err
}
return typeurl.MarshalAny(stats)
return protobuf.MarshalAnyToProto(stats)
}
// Cgroup returns the underlying cgroup for a linux task