atlasbot: refine ready/pod counts
This commit is contained in:
parent
d74277a8bd
commit
d2ade61d88
@ -1102,6 +1102,15 @@ def snapshot_metric_answer(
|
||||
pending = metrics.get("pods_pending")
|
||||
failed = metrics.get("pods_failed")
|
||||
succeeded = metrics.get("pods_succeeded")
|
||||
if "pending" in q and pending is not None:
|
||||
return _format_confidence(f"Pending pods: {pending:.0f}.", "high")
|
||||
if "failed" in q and failed is not None:
|
||||
return _format_confidence(f"Failed pods: {failed:.0f}.", "high")
|
||||
if "succeeded" in q or "completed" in q:
|
||||
if succeeded is not None:
|
||||
return _format_confidence(f"Succeeded pods: {succeeded:.0f}.", "high")
|
||||
if "running" in q and running is not None:
|
||||
return _format_confidence(f"Running pods: {running:.0f}.", "high")
|
||||
parts = []
|
||||
if running is not None:
|
||||
parts.append(f"running {running:.0f}")
|
||||
@ -1254,6 +1263,10 @@ def structured_answer(
|
||||
if missing:
|
||||
msg += f" Missing: {', '.join(missing)}."
|
||||
return _format_confidence(msg, "high")
|
||||
if only_ready is True:
|
||||
return _format_confidence(f"Ready nodes: {len(names)}.", "high")
|
||||
if only_ready is False:
|
||||
return _format_confidence(f"Not ready nodes: {len(names)}.", "high")
|
||||
if not (include_hw or exclude_hw or nodes_in_query or only_workers or role_filters):
|
||||
return _format_confidence(f"Atlas has {len(names)} nodes.", "high")
|
||||
return _format_confidence(f"Matching nodes: {len(names)}.", "high")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user