[core]: create_lxc - fix offline issue with alpine packages (#6994)
This commit is contained in:
parent
7df1dbaf17
commit
c60098d8eb
@ -250,12 +250,23 @@ fi
|
|||||||
|
|
||||||
# Update LXC template list
|
# Update LXC template list
|
||||||
TEMPLATE_SEARCH="${PCT_OSTYPE}-${PCT_OSVERSION:-}"
|
TEMPLATE_SEARCH="${PCT_OSTYPE}-${PCT_OSVERSION:-}"
|
||||||
|
case "$PCT_OSTYPE" in
|
||||||
|
debian|ubuntu)
|
||||||
|
TEMPLATE_PATTERN="-standard_"
|
||||||
|
;;
|
||||||
|
alpine|fedora|rocky|centos)
|
||||||
|
TEMPLATE_PATTERN="-default_"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
TEMPLATE_PATTERN=""
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# 1. Check local templates first
|
# 1. Check local templates first
|
||||||
msg_info "Searching for template '$TEMPLATE_SEARCH'"
|
msg_info "Searching for template '$TEMPLATE_SEARCH'"
|
||||||
mapfile -t TEMPLATES < <(
|
mapfile -t TEMPLATES < <(
|
||||||
pveam list "$TEMPLATE_STORAGE" |
|
pveam list "$TEMPLATE_STORAGE" |
|
||||||
awk -v s="$TEMPLATE_SEARCH" '$1 ~ s && $1 ~ /-standard_/ {print $1}' |
|
awk -v s="$TEMPLATE_SEARCH" -v p="$TEMPLATE_PATTERN" '$1 ~ s && $1 ~ p {print $1}' |
|
||||||
sed 's/.*\///' | sort -t - -k 2 -V
|
sed 's/.*\///' | sort -t - -k 2 -V
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -267,8 +278,8 @@ else
|
|||||||
mapfile -t TEMPLATES < <(
|
mapfile -t TEMPLATES < <(
|
||||||
pveam update >/dev/null 2>&1 &&
|
pveam update >/dev/null 2>&1 &&
|
||||||
pveam available -section system |
|
pveam available -section system |
|
||||||
sed -n "s/.*\($TEMPLATE_SEARCH.*-standard_.*\)/\1/p" |
|
sed -n "s/.*\($TEMPLATE_SEARCH.*$TEMPLATE_PATTERN.*\)/\1/p" |
|
||||||
sort -t - -k 2 -V
|
sort -t - -k 2 -V
|
||||||
)
|
)
|
||||||
TEMPLATE_SOURCE="online"
|
TEMPLATE_SOURCE="online"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user