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:
@@ -977,7 +977,7 @@ func (bdw *BoltDB) AddManifestSignature(repo string, signedManifestDigest godige
|
||||
LayersInfo: mConvert.GetProtoLayersInfo(sigMeta.LayersInfo),
|
||||
}
|
||||
|
||||
if zcommon.IsCosignTag(sigMeta.SignatureTag) {
|
||||
if zcommon.IsCosignSignature(sigMeta.SignatureTag) {
|
||||
// the entry for "sha256-{digest}.sig" signatures should be overwritten if
|
||||
// it exists or added on the first position if it doesn't exist
|
||||
if len(signatureSlice.GetList()) == 0 {
|
||||
|
||||
@@ -534,11 +534,19 @@ func GetImageMeta(dbImageMeta *proto_go.ImageMeta) mTypes.ImageMeta {
|
||||
manifests := make([]ispec.Descriptor, 0, len(dbImageMeta.GetManifests()))
|
||||
|
||||
for _, manifest := range dbImageMeta.GetIndex().GetIndex().GetManifests() {
|
||||
manifests = append(manifests, ispec.Descriptor{
|
||||
MediaType: manifest.GetMediaType(),
|
||||
Digest: godigest.Digest(manifest.GetDigest()),
|
||||
Size: manifest.GetSize(),
|
||||
})
|
||||
desc := ispec.Descriptor{
|
||||
MediaType: manifest.GetMediaType(),
|
||||
Digest: godigest.Digest(manifest.GetDigest()),
|
||||
Size: manifest.GetSize(),
|
||||
Annotations: manifest.Annotations,
|
||||
}
|
||||
|
||||
if manifest.Platform != nil {
|
||||
platform := GetPlatform(manifest.Platform)
|
||||
desc.Platform = &platform
|
||||
}
|
||||
|
||||
manifests = append(manifests, desc)
|
||||
}
|
||||
|
||||
imageMeta.Index = &ispec.Index{
|
||||
|
||||
@@ -1280,7 +1280,7 @@ func (dwr *DynamoDB) AddManifestSignature(repo string, signedManifestDigest godi
|
||||
LayersInfo: mConvert.GetProtoLayersInfo(sigMeta.LayersInfo),
|
||||
}
|
||||
|
||||
if zcommon.IsCosignTag(sigMeta.SignatureTag) {
|
||||
if zcommon.IsCosignSignature(sigMeta.SignatureTag) {
|
||||
// the entry for "sha256-{digest}.sig" signatures should be overwritten if
|
||||
// it exists or added on the first position if it doesn't exist
|
||||
if len(signatureSlice.GetList()) == 0 {
|
||||
|
||||
+1
-1
@@ -404,7 +404,7 @@ func isSignature(reference string, manifestContent ispec.Manifest) (bool, string
|
||||
return true, CosignType, manifestContent.Subject.Digest
|
||||
}
|
||||
|
||||
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