fix: update capacity validation to default to 1 if empty in preflight checks

This commit is contained in:
S
2026-03-02 08:12:21 -05:00
parent b2cf192707
commit c5e3f43806

View File

@@ -165,8 +165,10 @@ check_runners_ini_format() {
errors=$((errors + 1))
fi
# capacity: positive integer >= 1
if [[ -n "$capacity" ]] && ! [[ "$capacity" =~ ^[1-9][0-9]*$ ]]; then
# capacity: positive integer >= 1 (defaults to 1 at runtime if empty)
if [[ -z "$capacity" ]]; then
log_warn " → [$section] capacity is empty (will default to 1 at runtime)"
elif ! [[ "$capacity" =~ ^[1-9][0-9]*$ ]]; then
log_error " → [$section] capacity='$capacity' (must be positive integer >= 1)"
errors=$((errors + 1))
fi
@@ -250,7 +252,7 @@ REQUIRED_VARS=(
GITEA_BACKUP_INTERNAL_URL BACKUP_STORAGE_PATH
GITHUB_USERNAME GITHUB_TOKEN
REPO_NAMES
RUNNER_DEFAULT_IMAGE RUNNER_DATA_BASE_PATH LOCAL_RUNNER_DATA_BASE_PATH
RUNNER_DEFAULT_IMAGE
TLS_MODE CADDY_DOMAIN CADDY_DATA_PATH
)