diff options
| author | R0flcopt3r <12752060+R0flcopt3r@users.noreply.github.com> | 2025-03-16 18:33:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-16 13:33:49 -0400 |
| commit | f1d14428d11a562a537942bc6e2fed8bcea60a70 (patch) | |
| tree | 069662d52f6320d8b4fc30753e5847db4bdd242e /Justfile | |
| parent | 346e234f4522274438d9937ed7a98f45fd9f9316 (diff) | |
| download | AeroCore-OS-f1d14428d11a562a537942bc6e2fed8bcea60a70.tar.gz AeroCore-OS-f1d14428d11a562a537942bc6e2fed8bcea60a70.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-- | Justfile | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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}" |
