diff --git a/services/comms/atlasbot-deployment.yaml b/services/comms/atlasbot-deployment.yaml index fe1e906..7aedf4a 100644 --- a/services/comms/atlasbot-deployment.yaml +++ b/services/comms/atlasbot-deployment.yaml @@ -16,7 +16,7 @@ spec: labels: app: atlasbot annotations: - checksum/atlasbot-configmap: manual-atlasbot-7 + checksum/atlasbot-configmap: manual-atlasbot-8 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" diff --git a/services/comms/scripts/atlasbot/bot.py b/services/comms/scripts/atlasbot/bot.py index b2ac1c9..6fb6bff 100644 --- a/services/comms/scripts/atlasbot/bot.py +++ b/services/comms/scripts/atlasbot/bot.py @@ -466,6 +466,27 @@ def nodes_summary(cluster_name: str) -> str: return f"{cluster_name} cluster has {total} nodes: {ready} Ready, {not_ready} NotReady." return f"{cluster_name} cluster has {total} nodes, all Ready." +def nodes_names_summary(cluster_name: str) -> str: + try: + data = k8s_get("/api/v1/nodes?limit=500") + except Exception: + return "" + items = data.get("items") or [] + if not isinstance(items, list) or not items: + return "" + names = [] + for node in items: + name = (node.get("metadata") or {}).get("name") or "" + if name: + names.append(name) + names = sorted(set(names)) + if not names: + return "" + if len(names) <= 30: + return f"{cluster_name} node names: {', '.join(names)}." + shown = ", ".join(names[:30]) + return f"{cluster_name} node names: {shown}, … (+{len(names) - 30} more)." + def _strip_code_fence(text: str) -> str: cleaned = (text or "").strip() match = CODE_FENCE_RE.match(cleaned) @@ -633,6 +654,14 @@ def sync_loop(token: str, room_id: str): continue send_msg(token, rid, summary) continue + if re.search(r"\bnode names?\b|\bnodes? named\b|\bnaming\b", lower_body): + if any(word in lower_body for word in ("cluster", "atlas", "titan")): + names_summary = nodes_names_summary("Atlas") + if not names_summary: + send_msg(token, rid, "I couldn’t reach the cluster API to list node names. Try again in a moment.") + continue + send_msg(token, rid, names_summary) + continue # Only do live cluster/metrics introspection in DMs. allow_tools = is_dm