mirror of
https://github.com/project-zot/zot.git
synced 2025-02-17 23:45:36 -05:00
fix(sync): also add docker v2 mediatype as supported in sync (#1084)
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
parent
85a7053d9c
commit
50bdc2f402
2 changed files with 18 additions and 4 deletions
|
@ -680,7 +680,8 @@ func descriptorEqual(desc1, desc2 ispec.Descriptor) bool {
|
||||||
func isSupportedMediaType(mediaType string) bool {
|
func isSupportedMediaType(mediaType string) bool {
|
||||||
return mediaType == ispec.MediaTypeImageIndex ||
|
return mediaType == ispec.MediaTypeImageIndex ||
|
||||||
mediaType == ispec.MediaTypeImageManifest ||
|
mediaType == ispec.MediaTypeImageManifest ||
|
||||||
mediaType == manifest.DockerV2ListMediaType
|
mediaType == manifest.DockerV2ListMediaType ||
|
||||||
|
mediaType == manifest.DockerV2Schema2MediaType
|
||||||
}
|
}
|
||||||
|
|
||||||
func getImageRefManifest(ctx context.Context, upstreamCtx *types.SystemContext, imageRef types.ImageReference,
|
func getImageRefManifest(ctx context.Context, upstreamCtx *types.SystemContext, imageRef types.ImageReference,
|
||||||
|
|
|
@ -53,13 +53,12 @@ function teardown_file() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# sync image
|
# sync image
|
||||||
@test "sync docker image on demand" {
|
@test "sync docker image list on demand" {
|
||||||
run skopeo --insecure-policy copy --src-tls-verify=false \
|
run skopeo --insecure-policy copy --multi-arch=all --src-tls-verify=false \
|
||||||
docker://127.0.0.1:8090/registry \
|
docker://127.0.0.1:8090/registry \
|
||||||
oci:${TEST_DATA_DIR}
|
oci:${TEST_DATA_DIR}
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
|
|
||||||
run curl http://127.0.0.1:8090/v2/_catalog
|
run curl http://127.0.0.1:8090/v2/_catalog
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ $(echo "${lines[-1]}" | jq '.repositories[]') = '"registry"' ]
|
[ $(echo "${lines[-1]}" | jq '.repositories[]') = '"registry"' ]
|
||||||
|
@ -67,3 +66,17 @@ function teardown_file() {
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"latest"' ]
|
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"latest"' ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "sync docker image on demand" {
|
||||||
|
run skopeo --insecure-policy copy --src-tls-verify=false \
|
||||||
|
docker://127.0.0.1:8090/archlinux \
|
||||||
|
oci:${TEST_DATA_DIR}
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
|
run curl http://127.0.0.1:8090/v2/_catalog
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[ $(echo "${lines[-1]}" | jq '.repositories[0]') = '"archlinux"' ]
|
||||||
|
run curl http://127.0.0.1:8090/v2/registry/tags/list
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"latest"' ]
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue