mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-28 21:30:41 +00:00
Validate storage space only if container storage set
Storage space validation now occurs only when CONTAINER_STORAGE is defined, preventing premature validation before storage selection in certain modes. This avoids unnecessary errors and aligns validation with actual container creation logic.
This commit is contained in:
+4
-1
@@ -2985,7 +2985,9 @@ $PCT_OPTIONS_STRING"
|
|||||||
export TEMPLATE_STORAGE="${var_template_storage:-}"
|
export TEMPLATE_STORAGE="${var_template_storage:-}"
|
||||||
export CONTAINER_STORAGE="${var_container_storage:-}"
|
export CONTAINER_STORAGE="${var_container_storage:-}"
|
||||||
|
|
||||||
# Validate storage space before attempting container creation
|
# Validate storage space only if CONTAINER_STORAGE is already set
|
||||||
|
# (Storage selection happens in create_lxc_container for some modes)
|
||||||
|
if [[ -n "$CONTAINER_STORAGE" ]]; then
|
||||||
msg_info "Validating storage space"
|
msg_info "Validating storage space"
|
||||||
if ! validate_storage_space "$CONTAINER_STORAGE" "$DISK_SIZE" "no"; then
|
if ! validate_storage_space "$CONTAINER_STORAGE" "$DISK_SIZE" "no"; then
|
||||||
local free_space
|
local free_space
|
||||||
@@ -2996,6 +2998,7 @@ $PCT_OPTIONS_STRING"
|
|||||||
exit 214
|
exit 214
|
||||||
fi
|
fi
|
||||||
msg_ok "Storage space validated"
|
msg_ok "Storage space validated"
|
||||||
|
fi
|
||||||
|
|
||||||
create_lxc_container || exit $?
|
create_lxc_container || exit $?
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user