fix: add host/type compatibility checks in runners.ini format validation

This commit is contained in:
S
2026-03-02 08:52:21 -05:00
parent c5f9bb506f
commit 97220181d8

View File

@@ -149,6 +149,20 @@ check_runners_ini_format() {
;;
esac
# host/type compatibility:
# - host=local requires type=native
# - host=unraid|fedora|custom requires type=docker
if [[ "$host" =~ ^(unraid|fedora|local|custom)$ ]] && [[ "$type" =~ ^(docker|native)$ ]]; then
if [[ "$host" == "local" ]] && [[ "$type" != "native" ]]; then
log_error " → [$section] invalid combo host='$host' type='$type' (host=local requires type=native)"
errors=$((errors + 1))
fi
if [[ "$host" != "local" ]] && [[ "$type" != "docker" ]]; then
log_error " → [$section] invalid combo host='$host' type='$type' (host=$host requires type=docker)"
errors=$((errors + 1))
fi
fi
# data_path: must start with / or ~/
# shellcheck disable=SC2088 # tilde intentionally stored as literal string
if [[ -z "$data_path" ]]; then