diff --git a/incus/backend.func b/incus/backend.func index 6c3bcba..939cfad 100644 --- a/incus/backend.func +++ b/incus/backend.func @@ -142,6 +142,16 @@ _incus_resolve_launch_image() { fi done + # Not on the image server under any name we know: take its newest version. + local newest + newest=$(incus image alias list images: "${os}/" -f csv 2>/dev/null | cut -d, -f1 | + awk -F/ 'NF == 2 && $2 ~ /^[0-9][0-9.]*$/ {print $2}' | sort -uV | tail -n1 || true) + if [[ -n "$newest" ]] && incus image info "images:${os}/${newest}" &>/dev/null; then + msg_warn "${os} ${ver} is not on the image server; using ${os} ${newest}" + INCUS_LAUNCH_IMAGE="images:${os}/${newest}" + return 0 + fi + # Last resort: try remote launch of primary (incus may pull on demand) INCUS_LAUNCH_IMAGE="images:${os}/${ver}" return 1 diff --git a/incus/core.func b/incus/core.func index eb0421a..35c362b 100644 --- a/incus/core.func +++ b/incus/core.func @@ -1041,6 +1041,26 @@ incus_get_image_alias() { *) echo "3.21" ;; esac ;; + # The ct scripts carry Proxmox template versions; these are the image names. + archlinux) echo "current" ;; + centos) + case "$version" in + 9 | 9-Stream) echo "9-Stream" ;; + *) echo "10-Stream" ;; + esac + ;; + devuan) + case "$version" in + 5 | 5.0 | daedalus) echo "daedalus" ;; + *) echo "excalibur" ;; + esac + ;; + gentoo) + case "$version" in + systemd) echo "systemd" ;; + *) echo "openrc" ;; + esac + ;; *) echo "${version}" ;;