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:
peusebiu
2025-04-16 02:58:15 +03:00
committed by GitHub
parent 2592d4c784
commit 0e2aa81439
58 changed files with 2279 additions and 3741 deletions
+1 -11
View File
@@ -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
+1 -1
View File
@@ -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]