mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +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:
@@ -51,7 +51,7 @@ func WriteImageToFileSystem(image Image, repoName, ref string, storeController s
|
||||
return err
|
||||
}
|
||||
|
||||
_, _, err = store.PutImageManifest(repoName, ref, image.Manifest.MediaType, manifestBlob)
|
||||
_, _, err = store.PutImageManifest(repoName, ref, image.Manifest.MediaType, manifestBlob, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -82,7 +82,7 @@ func WriteMultiArchImageToFileSystem(multiarchImage MultiarchImage, repoName, re
|
||||
}
|
||||
|
||||
_, _, err = store.PutImageManifest(repoName, ref, multiarchImage.Index.MediaType,
|
||||
indexBlob)
|
||||
indexBlob, nil)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ func TestWriteImageToFileSystem(t *testing.T) {
|
||||
"tag",
|
||||
storage.StoreController{
|
||||
DefaultStore: mocks.MockedImageStore{
|
||||
PutImageManifestFn: func(repo, reference, mediaType string, body []byte,
|
||||
PutImageManifestFn: func(repo, reference, mediaType string, body []byte, _ []string,
|
||||
) (godigest.Digest, godigest.Digest, error) {
|
||||
return "", "", ErrTestError
|
||||
},
|
||||
|
||||
@@ -23,8 +23,8 @@ type MockedImageStore struct {
|
||||
GetNextRepositoriesFn func(lastRepo string, maxEntries int, fn storageTypes.FilterRepoFunc) ([]string, bool, error)
|
||||
GetImageTagsFn func(repo string) ([]string, error)
|
||||
GetImageManifestFn func(repo string, reference string) ([]byte, godigest.Digest, string, error)
|
||||
PutImageManifestFn func(repo string, reference string, mediaType string, body []byte) (godigest.Digest,
|
||||
godigest.Digest, error)
|
||||
PutImageManifestFn func(repo string, reference string, mediaType string, body []byte,
|
||||
extraTags []string) (godigest.Digest, godigest.Digest, error)
|
||||
DeleteImageManifestFn func(repo string, reference string, detectCollision bool) error
|
||||
BlobUploadPathFn func(repo string, uuid string) string
|
||||
StatBlobUploadFn func(repo string, uuid string) (bool, int64, time.Time, error)
|
||||
@@ -163,9 +163,10 @@ func (is MockedImageStore) PutImageManifest(
|
||||
reference string,
|
||||
mediaType string,
|
||||
body []byte,
|
||||
extraTags []string,
|
||||
) (godigest.Digest, godigest.Digest, error) {
|
||||
if is.PutImageManifestFn != nil {
|
||||
return is.PutImageManifestFn(repo, reference, mediaType, body)
|
||||
return is.PutImageManifestFn(repo, reference, mediaType, body, extraTags)
|
||||
}
|
||||
|
||||
return "", "", nil
|
||||
|
||||
Reference in New Issue
Block a user