mirror of
https://github.com/project-zot/zot.git
synced 2026-06-18 05:28:07 +08:00
feat: support pushing multiple tags for a single manifest (#3885)
* feat: support pushing multiple tags for a single manifest See https://github.com/opencontainers/distribution-spec/pull/600 Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com> * fix: constants not replaced in swagger output Also godot mandates comments ending in dots, which produces bad results in the swagger generated files, see the extra ". which is now fixed below: ``` diff --git a/swagger/docs.go b/swagger/docs.go index 84b08277..fb2c45c3 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -114,7 +114,7 @@ const docTemplate = `{ } }, "400": { - "description": "bad request\".", + "description": "bad request", "schema": { "type": "string" } @@ -200,7 +200,7 @@ const docTemplate = `{ } }, "400": { - "description": "bad request\".", + "description": "bad request", "schema": { "type": "string" } diff --git a/swagger/swagger.json b/swagger/swagger.json index cfeb3900..247f95fa 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -106,7 +106,7 @@ } }, "400": { - "description": "bad request\".", + "description": "bad request", "schema": { "type": "string" } @@ -192,7 +192,7 @@ } }, "400": { - "description": "bad request\".", + "description": "bad request", "schema": { "type": "string" } diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 57641c2f..09b30dcc 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -310,7 +310,7 @@ paths: schema: type: string "400": - description: bad request". + description: bad request schema: type: string "500": @@ -366,7 +366,7 @@ paths: schema: type: string "400": - description: bad request". + description: bad request schema: type: string "500": ``` Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com> --------- Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
This commit is contained in:
@@ -218,7 +218,7 @@ func (registry *DestinationRegistry) copyManifest(repo string, desc ispec.Descri
|
||||
}
|
||||
|
||||
digest, _, err := imageStore.PutImageManifest(repo, reference,
|
||||
desc.MediaType, manifestContent)
|
||||
desc.MediaType, manifestContent, nil)
|
||||
if err != nil {
|
||||
registry.log.Error().Str("errorType", common.TypeOf(err)).
|
||||
Err(err).Msg("couldn't upload manifest")
|
||||
@@ -299,7 +299,7 @@ func (registry *DestinationRegistry) copyManifest(repo string, desc ispec.Descri
|
||||
return firstMissingErr
|
||||
}
|
||||
|
||||
_, _, err := imageStore.PutImageManifest(repo, reference, desc.MediaType, manifestContent)
|
||||
_, _, err := imageStore.PutImageManifest(repo, reference, desc.MediaType, manifestContent, nil)
|
||||
if err != nil {
|
||||
registry.log.Error().Str("errorType", common.TypeOf(err)).Str("repo", repo).Str("reference", reference).
|
||||
Err(err).Msg("failed to upload manifest")
|
||||
|
||||
@@ -864,7 +864,7 @@ func TestDestinationRegistry(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
digest = godigest.FromBytes(content)
|
||||
So(digest, ShouldNotBeNil)
|
||||
_, _, err = imgStore.PutImageManifest(repoName, digest.String(), ispec.MediaTypeImageManifest, content)
|
||||
_, _, err = imgStore.PutImageManifest(repoName, digest.String(), ispec.MediaTypeImageManifest, content, nil)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
index.Manifests = append(index.Manifests, ispec.Descriptor{
|
||||
@@ -880,7 +880,7 @@ func TestDestinationRegistry(t *testing.T) {
|
||||
indexDigest := godigest.FromBytes(indexContent)
|
||||
So(indexDigest, ShouldNotBeNil)
|
||||
|
||||
_, _, err = imgStore.PutImageManifest(repoName, "1.0", ispec.MediaTypeImageIndex, indexContent)
|
||||
_, _, err = imgStore.PutImageManifest(repoName, "1.0", ispec.MediaTypeImageIndex, indexContent, nil)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
Convey("sync index image", func() {
|
||||
@@ -1067,7 +1067,7 @@ func TestDestinationRegistry(t *testing.T) {
|
||||
So(manifestDigest, ShouldNotBeNil)
|
||||
|
||||
// Store the manifest in the temp image store
|
||||
_, _, err = tempImgStore.PutImageManifest(repoName, manifestDigest.String(), ispec.MediaTypeImageManifest, manifestContent)
|
||||
_, _, err = tempImgStore.PutImageManifest(repoName, manifestDigest.String(), ispec.MediaTypeImageManifest, manifestContent, nil)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
// Add to index
|
||||
@@ -1085,7 +1085,7 @@ func TestDestinationRegistry(t *testing.T) {
|
||||
So(indexDigest, ShouldNotBeNil)
|
||||
|
||||
// Store the index manifest in the temp image store
|
||||
_, _, err = tempImgStore.PutImageManifest(repoName, indexDigest.String(), ispec.MediaTypeImageIndex, indexContent)
|
||||
_, _, err = tempImgStore.PutImageManifest(repoName, indexDigest.String(), ispec.MediaTypeImageIndex, indexContent, nil)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
// Now remove one of the child manifest blobs to trigger the error
|
||||
@@ -1178,7 +1178,7 @@ func TestDestinationRegistry(t *testing.T) {
|
||||
digest = godigest.FromBytes(content)
|
||||
So(digest, ShouldNotBeNil)
|
||||
|
||||
_, _, err = imgStore.PutImageManifest(repoName, "2.0", ispec.MediaTypeImageManifest, content)
|
||||
_, _, err = imgStore.PutImageManifest(repoName, "2.0", ispec.MediaTypeImageManifest, content, nil)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
Convey("sync image", func() {
|
||||
|
||||
Reference in New Issue
Block a user