harness: fix hive-dashboard-links state dir — drop legacy /state, use /agents/*/state
This commit is contained in:
parent
66c481a07a
commit
8d3be74fd2
1 changed files with 5 additions and 9 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue