harness: fix hive-dashboard-links state dir — drop legacy /state, use /agents/*/state

This commit is contained in:
damocles 2026-05-21 23:13:23 +02:00 committed by Mara
parent 66c481a07a
commit 8d3be74fd2

View file

@ -525,15 +525,11 @@
};
environment.LINKS_JSON = builtins.toJSON config.hyperhive.dashboardLinks;
script = ''
STATE_DIR=""
for d in /state /agents/*/state; do
if [ -d "$d" ]; then
STATE_DIR="$d"
break
fi
done
if [ -z "$STATE_DIR" ]; then
echo "hive-dashboard-links: no state dir found; skipping"
# Sub-agents have their state dir bind-mounted at /agents/<name>/state.
# Use a glob — exactly one match per container at runtime.
STATE_DIR=$(echo /agents/*/state)
if [ ! -d "$STATE_DIR" ]; then
echo "hive-dashboard-links: no state dir found at /agents/*/state; skipping"
exit 0
fi
printf '%s' "$LINKS_JSON" > "$STATE_DIR/hyperhive-dashboard-links.json"