atlasbot: improve worker node answers

This commit is contained in:
Brad Stein 2026-01-26 18:18:42 -03:00
parent 7bb1bd96fc
commit 65781aaca7
2 changed files with 12 additions and 6 deletions

View File

@ -16,7 +16,7 @@ spec:
labels:
app: atlasbot
annotations:
checksum/atlasbot-configmap: manual-atlasbot-14
checksum/atlasbot-configmap: manual-atlasbot-15
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: "comms"
vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret"

View File

@ -1097,6 +1097,7 @@ def sync_loop(token: str, room_id: str):
ready_nodes, not_ready_nodes = worker_nodes_status()
total = len(ready_nodes) + len(not_ready_nodes)
if total:
missing_hint = missing_nodes_answer("Atlas")
if any(word in lower_body for word in ("ready", "not ready", "unready")):
if not_ready_nodes:
send_msg(
@ -1105,14 +1106,19 @@ def sync_loop(token: str, room_id: str):
f"Worker nodes not Ready: {', '.join(not_ready_nodes)}.",
)
else:
send_msg(token, rid, f"All {len(ready_nodes)} worker nodes are Ready.")
msg = f"All {len(ready_nodes)} worker nodes are Ready."
if missing_hint and "no missing" not in missing_hint:
msg += f" {missing_hint}"
send_msg(token, rid, msg)
continue
if any(word in lower_body for word in ("how many", "should")):
send_msg(
token,
rid,
f"Atlas has {total} worker nodes; {len(ready_nodes)} Ready, {len(not_ready_nodes)} NotReady.",
msg = (
f"Atlas has {total} worker nodes; "
f"{len(ready_nodes)} Ready, {len(not_ready_nodes)} NotReady."
)
if missing_hint and "no missing" not in missing_hint:
msg += f" {missing_hint}"
send_msg(token, rid, msg)
continue
if "missing" in lower_body and "node" in lower_body:
missing = missing_nodes_answer("Atlas")