diff: hide types.Any from clients
This commit hides types.Any from the diff package's interface. Clients (incl. imgcrypt) shouldn't aware about gogo/protobuf. Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"github.com/containerd/containerd/mount"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/services"
|
||||
"github.com/containerd/typeurl"
|
||||
"github.com/opencontainers/go-digest"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"google.golang.org/grpc"
|
||||
@@ -102,7 +103,11 @@ func (l *local) Apply(ctx context.Context, er *diffapi.ApplyRequest, _ ...grpc.C
|
||||
|
||||
var opts []diff.ApplyOpt
|
||||
if er.Payloads != nil {
|
||||
opts = append(opts, diff.WithPayloads(er.Payloads))
|
||||
payloads := make(map[string]typeurl.Any)
|
||||
for k, v := range er.Payloads {
|
||||
payloads[k] = v
|
||||
}
|
||||
opts = append(opts, diff.WithPayloads(payloads))
|
||||
}
|
||||
|
||||
for _, differ := range l.differs {
|
||||
|
||||
Reference in New Issue
Block a user