Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions incus/backend.func
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions incus/core.func
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
;;
Expand Down
Loading