mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
fix(sync): fixed skipping docker images when they already synced (#1521)
before syncing an image we first check if it's already present in our storage to do that we get the manifest from remote and compare it with the local one but in the case of syncing docker images, because the conversion to OCI format is done while syncing, we get a docker manifest before conversion, so sync detects that local manifest and remote one are different, so it starts syncing again. to overcome this, convert remote docker manifests to OCI manifests and then compare. Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
@@ -129,6 +129,15 @@ function teardown_file() {
|
||||
run curl http://127.0.0.1:8090/v2/registry/tags/list
|
||||
[ "$status" -eq 0 ]
|
||||
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"latest"' ]
|
||||
|
||||
# make sure image is skipped when synced again
|
||||
run skopeo --insecure-policy copy --multi-arch=all --src-tls-verify=false \
|
||||
docker://127.0.0.1:8090/registry \
|
||||
oci:${TEST_DATA_DIR}
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
run $("cat /tmp/blackbox.log | grep -q registry:latest.*.skipping image because it's already synced")
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "sync docker image on demand" {
|
||||
@@ -143,6 +152,15 @@ function teardown_file() {
|
||||
run curl http://127.0.0.1:8090/v2/archlinux/tags/list
|
||||
[ "$status" -eq 0 ]
|
||||
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"latest"' ]
|
||||
|
||||
# make sure image is skipped when synced again
|
||||
run skopeo --insecure-policy copy --src-tls-verify=false \
|
||||
docker://127.0.0.1:8090/archlinux \
|
||||
oci:${TEST_DATA_DIR}
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
run $("cat /tmp/blackbox.log | grep -q archlinux:latest.*.skipping image because it's already synced")
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "sync k8s image list on demand" {
|
||||
|
||||
Reference in New Issue
Block a user