mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
feat(schema): add schema command to dump JSON Schema for zot config (#3905)
Fixes https://github.com/project-zot/zot/issues/3882 Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2fec21c839
commit
705939aed3
@@ -19,7 +19,7 @@ import (
|
||||
"github.com/opencontainers/image-spec/schema"
|
||||
imeta "github.com/opencontainers/image-spec/specs-go"
|
||||
ispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/santhosh-tekuri/jsonschema/v5"
|
||||
jsonschemaV5 "github.com/santhosh-tekuri/jsonschema/v5"
|
||||
|
||||
zerr "zotregistry.dev/zot/v2/errors"
|
||||
zcommon "zotregistry.dev/zot/v2/pkg/common"
|
||||
@@ -890,16 +890,12 @@ func ValidateImageIndexSchema(buf []byte) error {
|
||||
}
|
||||
|
||||
func IsEmptyLayersError(err error) bool {
|
||||
var validationErr *jsonschema.ValidationError
|
||||
if errors.As(err, &validationErr) {
|
||||
if len(validationErr.Causes) == 1 && strings.Contains(err.Error(), manifestWithEmptyLayersErrMsg) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
var validationErr *jsonschemaV5.ValidationError
|
||||
if !errors.As(err, &validationErr) {
|
||||
return false
|
||||
}
|
||||
|
||||
return false
|
||||
return len(validationErr.Causes) == 1 && strings.Contains(validationErr.Error(), manifestWithEmptyLayersErrMsg)
|
||||
}
|
||||
|
||||
// DedupeTaskGenerator takes all blobs paths found in the storage.imagestore and groups them by digest.
|
||||
|
||||
Reference in New Issue
Block a user