From 101cf1749e4955a9775c6e81eac7a507d8de0c9c Mon Sep 17 00:00:00 2001 From: Billy Zha Date: Tue, 7 May 2024 16:52:49 +0800 Subject: [PATCH] chore: project selected fields from OCI descriptor (#1362) Signed-off-by: Billy Zha --- cmd/oras/internal/display/metadata/model/descriptor.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/oras/internal/display/metadata/model/descriptor.go b/cmd/oras/internal/display/metadata/model/descriptor.go index 0dde6e47b..242d0ee4e 100644 --- a/cmd/oras/internal/display/metadata/model/descriptor.go +++ b/cmd/oras/internal/display/metadata/model/descriptor.go @@ -43,7 +43,13 @@ type Descriptor struct { func FromDescriptor(name string, desc ocispec.Descriptor) Descriptor { ret := Descriptor{ DigestReference: NewDigestReference(name, desc.Digest.String()), - Descriptor: desc, + Descriptor: ocispec.Descriptor{ + MediaType: desc.MediaType, + Size: desc.Size, + Digest: desc.Digest, + Annotations: desc.Annotations, + ArtifactType: desc.ArtifactType, + }, } return ret }