mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-02 22:03:01 +02:00
board/common: fix container upgrde for oci-archive:/ images
Add exception for local images, the "pull" step must be handled by the operator, i.e., wget of the latest image to the same location as set up in the image configuration, e.g., for oci-archive:/tmp/foo.tar.gz that /tmp/foo.tar.gz exists when issuing the upgrade command. Fixes #368 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -567,8 +567,14 @@ case $cmd in
|
||||
echo "No such container ($1), or invalid ImageName. Cannot upgrade."
|
||||
exit 1;
|
||||
fi
|
||||
podman stop "$1"
|
||||
podman pull "$img" || (echo "Failed fetching $img, check your network (settings)."; exit 1)
|
||||
if echo "$img" | grep -Eq '^localhost/'; then
|
||||
# Likely an OCI archive, or local directory, assume user has updated image.
|
||||
file=$(awk '{s=$NF} END{print s}' "/var/lib/containers/active/${1}.sh")
|
||||
echo "Upgrading container ${1} with local archive: $file ..."
|
||||
else
|
||||
podman stop "$1"
|
||||
podman pull "$img" || (echo "Failed fetching $img, check your network (settings)."; exit 1)
|
||||
fi
|
||||
"/var/lib/containers/active/${1}.sh" || (echo "Failed recreating container $1"; exit 1)
|
||||
;;
|
||||
volume)
|
||||
|
||||
Reference in New Issue
Block a user