summaryrefslogtreecommitdiff
path: root/Justfile
diff options
context:
space:
mode:
authorR0flcopt3r <12752060+R0flcopt3r@users.noreply.github.com>2025-03-16 18:33:49 +0100
committerGitHub <noreply@github.com>2025-03-16 13:33:49 -0400
commit007130fe49f5497f299765b0e479eb1ee1d27435 (patch)
tree069662d52f6320d8b4fc30753e5847db4bdd242e /Justfile
parented3affcb2f579cd904e600ed95c7b3fb95710a1b (diff)
downloadAeroCore-OS-007130fe49f5497f299765b0e479eb1ee1d27435.tar.gz
AeroCore-OS-007130fe49f5497f299765b0e479eb1ee1d27435.zip
fix: _rootful_load_image would not copy if the user image was different (#88)
Co-authored-by: Eirik O. Lavik <eirik.lavik@appear.net>
Diffstat (limited to 'Justfile')
-rw-r--r--Justfile6
1 files changed, 4 insertions, 2 deletions
diff --git a/Justfile b/Justfile
index ff51345..f12166c 100644
--- a/Justfile
+++ b/Justfile
@@ -157,11 +157,13 @@ _rootful_load_image $target_image=image_name $tag=default_tag:
return_code=$?
set -e
+ USER_IMG_ID=$(podman images --filter reference="${target_image}:${tag}" --format "'{{ '{{.ID}}' }}'")
+
if [[ $return_code -eq 0 ]]; then
# If the image is found, load it into rootful podman
ID=$(just sudoif podman images --filter reference="${target_image}:${tag}" --format "'{{ '{{.ID}}' }}'")
- if [[ -z "$ID" ]]; then
- # If the image ID is not found, copy the image from user podman to root podman
+ if [[ "$ID" != "$USER_IMG_ID" ]]; then
+ # If the image ID is not found or different from user, copy the image from user podman to root podman
COPYTMP=$(mktemp -p "${PWD}" -d -t _build_podman_scp.XXXXXXXXXX)
just sudoif TMPDIR=${COPYTMP} podman image scp ${UID}@localhost::"${target_image}:${tag}" root@localhost::"${target_image}:${tag}"
rm -rf "${COPYTMP}"