0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

fix: ignore metadb errors if tag not found (#2301)

This commit is contained in:
Ramkumar Chinchani 2024-03-12 22:28:08 -07:00 committed by GitHub
parent c7472a2dda
commit fdb401273c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View file

@ -514,7 +514,7 @@ func (rh *RouteHandler) GetManifest(response http.ResponseWriter, request *http.
if rh.c.MetaDB != nil {
err := meta.OnGetManifest(name, reference, mediaType, content, rh.c.StoreController, rh.c.MetaDB, rh.c.Log)
if err != nil {
if err != nil && !errors.Is(err, zerr.ErrImageMetaNotFound) {
response.WriteHeader(http.StatusInternalServerError)
return

View file

@ -100,7 +100,7 @@ func OnDeleteManifest(repo, reference, mediaType string, digest godigest.Digest,
return nil
}
// OnDeleteManifest is called when a manifest is downloaded. It increments the download couter on that manifest.
// OnGetManifest is called when a manifest is downloaded. It increments the download couter on that manifest.
func OnGetManifest(name, reference, mediaType string, body []byte,
storeController storage.StoreController, metaDB mTypes.MetaDB, log log.Logger,
) error {

View file

@ -136,6 +136,12 @@ function teardown_file() {
[ "$status" -eq 0 ]
local sigName=$(echo "${lines[-1]}" | jq '.[].critical.image."docker-manifest-digest"')
[[ "$sigName" == *"${digest}"* ]]
tags=( $(oras repo tags --plain-http localhost:${zot_port}/annotations) )
[ "$status" -eq 0 ]
local sigdes=$(oras manifest fetch --descriptor localhost:${zot_port}/annotations:${tags[1]} | jq .digest | tr -d \")
[ "$status" -eq 0 ]
run oras manifest fetch --plain-http localhost:${zot_port}/annotations@${sigdes}
[ "$status" -eq 0 ]
}
@test "sign/verify with cosign (only referrers)" {