Remove gogoproto.customtype

gogoproto.customtype is used to have go-digest.Digest instead of string.
While it is convinient, protoc-gen-go doesn't support the extension
and that blocks #6564.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
Kazuyoshi Kato
2022-03-18 21:20:58 +00:00
parent 0c701654a1
commit 3eeeb9429a
22 changed files with 296 additions and 335 deletions

View File

@@ -27,6 +27,7 @@ import (
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/services"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"google.golang.org/grpc"
)
@@ -170,7 +171,7 @@ func toMounts(apim []*types.Mount) []mount.Mount {
func toDescriptor(d *types.Descriptor) ocispec.Descriptor {
return ocispec.Descriptor{
MediaType: d.MediaType,
Digest: d.Digest,
Digest: digest.Digest(d.Digest),
Size: d.Size_,
Annotations: d.Annotations,
}
@@ -179,7 +180,7 @@ func toDescriptor(d *types.Descriptor) ocispec.Descriptor {
func fromDescriptor(d ocispec.Descriptor) *types.Descriptor {
return &types.Descriptor{
MediaType: d.MediaType,
Digest: d.Digest,
Digest: d.Digest.String(),
Size_: d.Size,
Annotations: d.Annotations,
}