From cf11b5a745f8577dafe698f512c2035ab1da2170 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 6 Sep 2022 20:28:24 +0200 Subject: [PATCH] Try using old image name of the Supervisor image (#2111) (#2113) * Try using old image name of the Supervisor image * Tag the old image with the new name so recreation works --- .../rootfs-overlay/usr/sbin/hassos-supervisor | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor b/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor index 580ab9b28..4842295d4 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor @@ -33,6 +33,13 @@ fi # If Supervisor image is missing, pull it mkdir -p "$(dirname ${SUPERVISOR_STARTUP_MARKER})" touch ${SUPERVISOR_STARTUP_MARKER} +if [ -z "${SUPERVISOR_IMAGE_ID}" ]; then + # Try tagging legacy image with current name and try get its ID + echo "[WARNING] Supervisor image missing, trying to use the legacy image name" + docker tag "homeassistant/${SUPERVISOR_ARCH}-hassio-supervisor:latest" "${SUPERVISOR_IMAGE}:latest" || true + SUPERVISOR_IMAGE_ID=$(docker images --no-trunc --filter "reference=${SUPERVISOR_IMAGE}:latest" --format "{{.ID}}" || echo "") +fi + if [ -z "${SUPERVISOR_IMAGE_ID}" ]; then # Get the latest from update information # Using updater information instead of config. If the config version is