diff --git a/atlasbot/snapshot/builder.py b/atlasbot/snapshot/builder.py index a119835..b274900 100644 --- a/atlasbot/snapshot/builder.py +++ b/atlasbot/snapshot/builder.py @@ -772,14 +772,23 @@ def _append_longhorn(lines: list[str], summary: dict[str, Any]) -> None: by_state = longhorn.get("by_state") if isinstance(longhorn.get("by_state"), dict) else {} by_robust = longhorn.get("by_robustness") if isinstance(longhorn.get("by_robustness"), dict) else {} if total is not None: - lines.append( - "longhorn: total={total}, attached={attached}, detached={detached}, degraded={degraded}".format( - total=total, - attached=attached if attached is not None else 0, - detached=detached if detached is not None else 0, - degraded=degraded if degraded is not None else 0, + if attached is None and detached is None and degraded is None: + unhealthy = longhorn.get("unhealthy_count") + lines.append( + "longhorn: total={total}, unhealthy={unhealthy}".format( + total=total, + unhealthy=unhealthy if unhealthy is not None else 0, + ) + ) + else: + lines.append( + "longhorn: total={total}, attached={attached}, detached={detached}, degraded={degraded}".format( + total=total, + attached=attached if attached is not None else 0, + detached=detached if detached is not None else 0, + degraded=degraded if degraded is not None else 0, + ) ) - ) if by_state: lines.append("longhorn_state: " + _format_kv_map(by_state)) if by_robust: