mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 20:38:08 +08:00
feat(api): added oci-subject header when pushing an image with subject field (#1415)
- as requested by the latest version of the oci distribution spec Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
@@ -180,7 +180,7 @@ func (sig *signaturesCopier) syncCosignSignature(localRepo, remoteRepo, digestSt
|
||||
}
|
||||
|
||||
// push manifest
|
||||
_, err = imageStore.PutImageManifest(localRepo, cosignTag,
|
||||
_, _, err = imageStore.PutImageManifest(localRepo, cosignTag,
|
||||
ispec.MediaTypeImageManifest, cosignManifestBuf)
|
||||
if err != nil {
|
||||
sig.log.Error().Str("errorType", common.TypeOf(err)).
|
||||
@@ -258,7 +258,7 @@ func (sig *signaturesCopier) syncORASRefs(localRepo, remoteRepo, digestStr strin
|
||||
}
|
||||
}
|
||||
|
||||
_, err = imageStore.PutImageManifest(localRepo, ref.Digest.String(),
|
||||
_, _, err = imageStore.PutImageManifest(localRepo, ref.Digest.String(),
|
||||
oras.MediaTypeArtifactManifest, body)
|
||||
if err != nil {
|
||||
sig.log.Error().Str("errorType", common.TypeOf(err)).
|
||||
@@ -359,7 +359,7 @@ func (sig *signaturesCopier) syncOCIRefs(localRepo, remoteRepo, digestStr string
|
||||
continue
|
||||
}
|
||||
|
||||
digest, err := imageStore.PutImageManifest(localRepo, ref.Digest.String(),
|
||||
digest, _, err := imageStore.PutImageManifest(localRepo, ref.Digest.String(),
|
||||
ref.MediaType, OCIRefBody)
|
||||
if err != nil {
|
||||
sig.log.Error().Str("errorType", common.TypeOf(err)).
|
||||
|
||||
@@ -698,7 +698,7 @@ func TestSyncInternal(t *testing.T) {
|
||||
|
||||
manifestDigest := godigest.FromBytes(manifestContent)
|
||||
|
||||
_, err = testImageStore.PutImageManifest(repo, manifestDigest.String(),
|
||||
_, _, err = testImageStore.PutImageManifest(repo, manifestDigest.String(),
|
||||
ispec.MediaTypeImageManifest, manifestContent)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
@@ -715,7 +715,7 @@ func TestSyncInternal(t *testing.T) {
|
||||
So(digest, ShouldNotBeNil)
|
||||
|
||||
// upload index image
|
||||
_, err = testImageStore.PutImageManifest(repo, "latest", ispec.MediaTypeImageIndex, content)
|
||||
_, _, err = testImageStore.PutImageManifest(repo, "latest", ispec.MediaTypeImageIndex, content)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
err = pushSyncedLocalImage(repo, "latest", testRootDir, nil, imageStore, log)
|
||||
|
||||
@@ -337,7 +337,7 @@ func pushSyncedLocalImage(localRepo, reference, localCachePath string,
|
||||
}
|
||||
}
|
||||
|
||||
_, err = imageStore.PutImageManifest(localRepo, reference, mediaType, manifestBlob)
|
||||
_, _, err = imageStore.PutImageManifest(localRepo, reference, mediaType, manifestBlob)
|
||||
if err != nil {
|
||||
log.Error().Str("errorType", common.TypeOf(err)).
|
||||
Err(err).Msg("couldn't upload manifest")
|
||||
@@ -393,7 +393,7 @@ func copyManifest(localRepo string, manifestContent []byte, reference string, re
|
||||
return err
|
||||
}
|
||||
|
||||
digest, err := imageStore.PutImageManifest(localRepo, reference,
|
||||
digest, _, err := imageStore.PutImageManifest(localRepo, reference,
|
||||
ispec.MediaTypeImageManifest, manifestContent)
|
||||
if err != nil {
|
||||
log.Error().Str("errorType", common.TypeOf(err)).
|
||||
|
||||
Reference in New Issue
Block a user