From 2f8ac193e94a51a0c6fa02c39636a7e95f0858f2 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mar 10 2023 18:21:36 +0000 Subject: [PATCH 1/2] sync-ostree: Clean up on exit We noticed a space leakage on failures. Signed-off-by: Colin Walters --- diff --git a/scripts/sync-ostree-base-containers.sh b/scripts/sync-ostree-base-containers.sh index f49be1f..5da1602 100755 --- a/scripts/sync-ostree-base-containers.sh +++ b/scripts/sync-ostree-base-containers.sh @@ -57,6 +57,10 @@ arch_to_goarch() { esac } +work_tmpdir=$(mktemp -d -p /var/tmp --suffix=.sync-ostree) +trap "{ rm -rf $work_tmpdir }" EXIT +cd "${work_tmpdir}" + for name in "${ostree_base_images[@]}"; do echo "Processing: ${name}" # The base name component, e.g. "fedora-silverblue" @@ -72,8 +76,8 @@ for name in "${ostree_base_images[@]}"; do aliased_name=${imgname}:${tagname} fi - work_dir=$(mktemp -d -p /var/tmp --suffix=.sync-ostree) - pushd ${work_dir} &> /dev/null + mkdir $name + pushd $name &> /dev/null # Note that this command will use the current architecture arch=$(arch) if ! runv skopeo inspect -n docker://${primary_imgtag} > inspect.json; then @@ -146,7 +150,7 @@ EOF done echo "done synchronizing ${name}" popd - rm "${work_dir}" -rf + rm "${name}" -rf done echo "done" From 1199cb02ee68731006f628dc5ee15218aed0e9d5 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mar 10 2023 18:21:36 +0000 Subject: [PATCH 2/2] sync-ostree: Remove duplicate `docker://` in alias path This caused a failure for rawhide. Signed-off-by: Colin Walters --- diff --git a/scripts/sync-ostree-base-containers.sh b/scripts/sync-ostree-base-containers.sh index 5da1602..48abfd2 100755 --- a/scripts/sync-ostree-base-containers.sh +++ b/scripts/sync-ostree-base-containers.sh @@ -138,7 +138,7 @@ EOF runv buildah manifest push --all "${imgtag}" ${target} # If we have an alias, synchronize that if test -n "${aliased_name}"; then - runv skopeo copy docker://${target} docker://${canonical_registry}/${aliased_name} + runv skopeo copy ${target} docker://${canonical_registry}/${aliased_name} fi # And handle secondary registries echo "Copying to secondary registries"