mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 17:11:30 +00:00
fix: stop-dev.sh incorrectly detects single-node as multi-node in Docker E2E
is_multinode() counted all [nodes.*] TOML subsections (daemon, nats, awsgw, etc.) instead of just top-level node entries. A single-node config has ~8 such sections, causing the single-node Docker E2E to use coordinated cluster shutdown and exit with code 254. Fix grep to match only [nodes.X] (not [nodes.X.Y]) and preserve the original test exit code in the cleanup trap.
This commit is contained in:
+2
-1
@@ -56,7 +56,8 @@ has_service() {
|
||||
is_multinode() {
|
||||
local config_file="$CONFIG_DIR/hive.toml"
|
||||
if [ -f "$config_file" ]; then
|
||||
local node_count=$(grep -c '^\[nodes\.' "$config_file")
|
||||
# Count only top-level node sections [nodes.X], not subsections [nodes.X.Y]
|
||||
local node_count=$(grep -cE '^\[nodes\.[^.]+\]' "$config_file")
|
||||
[ "$node_count" -gt 1 ]
|
||||
else
|
||||
return 1
|
||||
|
||||
@@ -35,6 +35,7 @@ cleanup() {
|
||||
fi
|
||||
fi
|
||||
./scripts/stop-dev.sh
|
||||
exit $EXIT_CODE
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user