Skip to content

Commit 9c1252b

Browse files
Merge pull request #4674 from ggiguash/optimize_mirror_images
USHIFT-5406: Optimize mirror images operation for repetitive runs
2 parents 47fd748 + 22e1eaa commit 9c1252b

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

scripts/mirror-images.sh

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,8 @@ function mirror_registry() {
7272
skopeo_retry copy ${skopeo_opts} --quiet \
7373
--preserve-digests \
7474
--authfile "${img_pull_file}" \
75+
--additional-tag "${dst_img_no_tag}:latest" \
7576
docker://"${src_img}" docker://"${dst_img}"
76-
77-
echo "Tagging '${dst_img_no_tag}' as 'latest'"
78-
# shellcheck disable=SC2086
79-
skopeo_retry copy ${skopeo_opts} --quiet \
80-
--preserve-digests \
81-
--authfile "${img_pull_file}" \
82-
docker://"${dst_img}" docker://"${dst_img_no_tag}:latest"
8377
}
8478

8579
# Export functions for xargs to use
@@ -153,14 +147,8 @@ function dir_to_registry() {
153147
skopeo_retry copy ${skopeo_opts} --quiet \
154148
--preserve-digests \
155149
--authfile "${img_pull_file}" \
150+
--additional-tag "${dst_img_no_tag}:latest" \
156151
dir://"${local_dir}/${src_img}" docker://"${dst_img}"
157-
158-
echo "Tagging '${dst_img}' as '${dst_img_no_tag}:latest'"
159-
# shellcheck disable=SC2086
160-
skopeo_retry copy ${skopeo_opts} --quiet \
161-
--preserve-digests \
162-
--authfile "${img_pull_file}" \
163-
docker://"${dst_img}" docker://"${dst_img_no_tag}:latest"
164152
}
165153

166154
# Export functions for xargs to use

test/bin/mirror_registry.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ finalize_registry() {
266266
# Ensure that permissions are open for the current user on the mirror registry
267267
# directories and files. This is necessary to avoid 'find' command errors.
268268
sudo chgrp -R "$(id -gn)" "${MIRROR_REGISTRY_DIR}"
269-
sudo find "${MIRROR_REGISTRY_DIR}" -type d -exec sudo chmod a+rx '{}' \;
270-
sudo find "${MIRROR_REGISTRY_DIR}" -type f -exec sudo chmod a+r '{}' \;
269+
sudo find "${MIRROR_REGISTRY_DIR}" -type d -exec chmod a+rx '{}' +
270+
sudo find "${MIRROR_REGISTRY_DIR}" -type f -exec chmod a+r '{}' +
271271
}
272272

273273
mirror_images() {

0 commit comments

Comments
 (0)