fix: add support for uploaded index when signing using notation (#1882)

ci(notation): update to latest notation version
fix(sync): add layers info when syncing signatures

Signed-off-by: Andreea-Lupu <andreealupu1470@yahoo.com>
This commit is contained in:
Andreea Lupu
2023-10-13 04:45:20 +03:00
committed by GitHub
parent 458d40fb48
commit fc2380b57b
24 changed files with 576 additions and 45 deletions
+9
View File
@@ -80,6 +80,10 @@ func ParseRepo(repo string, metaDB mTypes.MetaDB, storeController storage.StoreC
for _, descriptor := range indexContent.Manifests {
tag := descriptor.Annotations[ispec.AnnotationRefName]
if zcommon.IsReferrersTag(tag) {
continue
}
descriptorBlob, err := getCachedBlob(repo, descriptor, metaDB, imageStore, log)
if err != nil {
log.Error().Err(err).Msg("load-repo: error checking manifestMeta in MetaDB")
@@ -299,6 +303,11 @@ func getNotationSignatureLayersInfo(
return layers, err
}
// skip if is a notation index
if manifestContent.MediaType == ispec.MediaTypeImageIndex {
return []mTypes.LayerInfo{}, nil
}
if len(manifestContent.Layers) != 1 {
log.Error().Err(zerr.ErrBadManifest).Str("repository", repo).Str("reference", manifestDigest).
Msg("load-repo: notation signature manifest requires exactly one layer but it does not")