Skip to content

Commit eabc874

Browse files
committed
Inspect the image and skip the build if cached
1 parent c44ac1a commit eabc874

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

test/bin/mirror_registry.sh

+7
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ EOF
7676
[[registry.mirror]]
7777
location = "${MIRROR_REGISTRY_URL}"
7878
insecure = true
79+
80+
[[registry]]
81+
prefix = ""
82+
location = "localhost"
83+
[[registry.mirror]]
84+
location = "${MIRROR_REGISTRY_URL}"
85+
insecure = true
7986
EOF
8087

8188
# Complete the source registry configuration to use sigstore attachments.

test/bin/pyutils/build_bootc_images.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,20 @@ def should_skip(image, cached):
253253
# Redirect the output to the log file
254254
with open(cf_logfile, 'w') as logfile:
255255
is_cached = False
256-
# Attempt copying the container image from the mirror registry to
257-
# the local storage. Skip the subsequent build command if the image
258-
# has already been cached.
256+
# Check if the container image exists in the mirror registry and skip
257+
# the subsequent build command if the image has already been cached.
259258
#
260-
# Note: No retries. Failure to copy the image is ignored.
259+
# Note: No retries. Failure to inspect the image is ignored.
261260
try:
262-
copy_args = [
263-
"sudo", "skopeo", "copy",
261+
inspect_args = [
262+
"sudo", "skopeo", "inspect",
264263
"--authfile", PULL_SECRET,
265264
f"docker://{MIRROR_REGISTRY}/{cf_outname}",
266-
f"containers-storage:localhost/{cf_outname}"
265+
"&>/dev/null"
267266
]
268267
start = time.time()
269-
common.run_command_in_shell(copy_args, dry_run, logfile, logfile)
270-
common.record_junit(cf_path, "copy-image", "OK", start)
268+
common.run_command_in_shell(inspect_args, dry_run, logfile, logfile)
269+
common.record_junit(cf_path, "inspect-image", "OK", start)
271270

272271
is_cached = True
273272
except Exception:

0 commit comments

Comments
 (0)