mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
gc: fix test cases since umoci GC is more strict
umoci GC enforces a valid index.json and current tests were a little lax.
This commit is contained in:
@@ -15,9 +15,9 @@ import (
|
||||
"github.com/anuvu/zot/errors"
|
||||
zlog "github.com/anuvu/zot/pkg/log"
|
||||
guuid "github.com/gofrs/uuid"
|
||||
"github.com/openSUSE/umoci"
|
||||
godigest "github.com/opencontainers/go-digest"
|
||||
ispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/openSUSE/umoci"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
@@ -335,6 +335,11 @@ func (is *ImageStore) PutImageManifest(repo string, reference string, mediaType
|
||||
return "", errors.ErrBadManifest
|
||||
}
|
||||
|
||||
if m.SchemaVersion != 2 {
|
||||
is.log.Error().Int("SchemaVersion", m.SchemaVersion).Msg("invalid manifest")
|
||||
return "", errors.ErrBadManifest
|
||||
}
|
||||
|
||||
for _, l := range m.Layers {
|
||||
digest := l.Digest
|
||||
blobPath := is.BlobPath(repo, digest)
|
||||
|
||||
Reference in New Issue
Block a user