Skip to content

Commit

Permalink
chore: project selected fields from OCI descriptor (#1362)
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah authored May 7, 2024
1 parent 3812a2d commit 101cf17
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/oras/internal/display/metadata/model/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 101cf17

Please sign in to comment.