mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
feat(sync): use regclient for sync extension (#2903)
* feat(sync): use regclient for sync extension replaced containers/image package with regclient/regclient package Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com> * fix(sync): fixed converting innner docker list mediatype Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com> * feat(sync): added option to preserve digest Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com> * fix(sync): added coverage and various fixes Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com> * fix(metadb): fixed converting manifest list not setting platform and annotations Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com> * fix(sync): remove read lock on storage, not used concurrently Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com> * feat(sync): added cache for repo tags Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com> * fix(sync): fixed Makefile removed opengpg tag Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com> * fix(sync): add test for on demand referrer Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com> --------- Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>
This commit is contained in:
+1
-11
@@ -322,7 +322,7 @@ func (gc GarbageCollect) removeReferrer(repo string, index *ispec.Index, manifes
|
||||
// cosign
|
||||
tag, ok := getDescriptorTag(manifestDesc)
|
||||
if ok {
|
||||
if isCosignTag(tag) {
|
||||
if zcommon.IsCosignTag(tag) {
|
||||
subjectDigest := getSubjectFromCosignTag(tag)
|
||||
referenced := isManifestReferencedInIndex(index, subjectDigest)
|
||||
|
||||
@@ -785,16 +785,6 @@ func getDescriptorTag(desc ispec.Descriptor) (string, bool) {
|
||||
return tag, ok
|
||||
}
|
||||
|
||||
// this function will check if tag is a cosign tag (signature or sbom).
|
||||
func isCosignTag(tag string) bool {
|
||||
if strings.HasPrefix(tag, "sha256-") &&
|
||||
(strings.HasSuffix(tag, cosignSignatureTagSuffix) || strings.HasSuffix(tag, SBOMTagSuffix)) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/*
|
||||
GCTaskGenerator takes all repositories found in the storage.imagestore
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ func CheckIsImageSignature(repoName string, manifestBlob []byte, reference strin
|
||||
return true, CosignType, manifestContent.Subject.Digest, nil
|
||||
}
|
||||
|
||||
if tag := reference; zcommon.IsCosignTag(reference) {
|
||||
if tag := reference; zcommon.IsCosignSignature(reference) {
|
||||
prefixLen := len("sha256-")
|
||||
digestLen := 64
|
||||
signedImageManifestDigestEncoded := tag[prefixLen : prefixLen+digestLen]
|
||||
|
||||
Reference in New Issue
Block a user