Skip to content

Commit

Permalink
Add annotation for descriptor
Browse files Browse the repository at this point in the history
Signed-off-by: Tosone <i@tosone.cn>
  • Loading branch information
tosone committed Oct 16, 2023
1 parent c78d6f9 commit 9f97753
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion manifest/ocischema/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ func init() {
}

dgst := digest.FromBytes(b)
return m, distribution.Descriptor{Digest: dgst, Size: int64(len(b)), MediaType: v1.MediaTypeImageIndex}, err
return m, distribution.Descriptor{
MediaType: v1.MediaTypeImageIndex,
Digest: dgst,
Size: int64(len(b)),
Annotations: m.Annotations,
}, err
}
err := distribution.RegisterManifestSchema(v1.MediaTypeImageIndex, imageIndexFunc)
if err != nil {
Expand Down
7 changes: 6 additions & 1 deletion manifest/ocischema/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ func init() {
}

dgst := digest.FromBytes(b)
return m, distribution.Descriptor{Digest: dgst, Size: int64(len(b)), MediaType: v1.MediaTypeImageManifest}, err
return m, distribution.Descriptor{
MediaType: v1.MediaTypeImageManifest,
Digest: dgst,
Size: int64(len(b)),
Annotations: m.Annotations,
}, err
}
err := distribution.RegisterManifestSchema(v1.MediaTypeImageManifest, ocischemaFunc)
if err != nil {
Expand Down

0 comments on commit 9f97753

Please sign in to comment.