mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-12-14 03:03:28 +01:00
fix(build): skip -features flag when empty (#9871)
Fixes '400 too many arguments' error when creating privileged containers without nesting/fuse features enabled.
This commit is contained in:
@ -1047,7 +1047,7 @@ advanced_settings() {
|
|||||||
local _enable_mknod="${var_mknod:-0}"
|
local _enable_mknod="${var_mknod:-0}"
|
||||||
local _mount_fs="${var_mount_fs:-}"
|
local _mount_fs="${var_mount_fs:-}"
|
||||||
local _protect_ct="${var_protection:-no}"
|
local _protect_ct="${var_protection:-no}"
|
||||||
|
|
||||||
# Detect host timezone for default (if not set via var_timezone)
|
# Detect host timezone for default (if not set via var_timezone)
|
||||||
local _host_timezone=""
|
local _host_timezone=""
|
||||||
if command -v timedatectl >/dev/null 2>&1; then
|
if command -v timedatectl >/dev/null 2>&1; then
|
||||||
@ -2630,10 +2630,15 @@ build_container() {
|
|||||||
export DEV_MODE_DRYRUN="${DEV_MODE_DRYRUN:-false}"
|
export DEV_MODE_DRYRUN="${DEV_MODE_DRYRUN:-false}"
|
||||||
|
|
||||||
# Build PCT_OPTIONS as multi-line string
|
# Build PCT_OPTIONS as multi-line string
|
||||||
PCT_OPTIONS_STRING=" -features $FEATURES
|
PCT_OPTIONS_STRING=" -hostname $HN
|
||||||
-hostname $HN
|
|
||||||
-tags $TAGS"
|
-tags $TAGS"
|
||||||
|
|
||||||
|
# Only add -features if FEATURES is not empty
|
||||||
|
if [ -n "$FEATURES" ]; then
|
||||||
|
PCT_OPTIONS_STRING=" -features $FEATURES
|
||||||
|
$PCT_OPTIONS_STRING"
|
||||||
|
fi
|
||||||
|
|
||||||
# Add storage if specified
|
# Add storage if specified
|
||||||
if [ -n "$SD" ]; then
|
if [ -n "$SD" ]; then
|
||||||
PCT_OPTIONS_STRING="$PCT_OPTIONS_STRING
|
PCT_OPTIONS_STRING="$PCT_OPTIONS_STRING
|
||||||
|
|||||||
Reference in New Issue
Block a user