From dbf631312e1e1b62c92ad5384673cf2309f700ad Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Fri, 24 Jul 2026 21:30:54 +0200 Subject: [PATCH] v0.169.1: disk-health card excludes logical/network storage (pbs/lvm/nfs/cifs) The agent defaults SMART to UNKNOWN on non-physical targets, so they showed as spurious 'Nincs adat' rows. isPhysicalDisk now excludes those types (card + check). Test strengthened: a PBS/LVM fixture with UNKNOWN SMART must still be excluded. --- CHANGELOG.md | 7 +++++++ controller/internal/web/disk_health.go | 9 +++++++-- controller/internal/web/disk_health_test.go | 6 ++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 436dabd..a37409d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ## Changelog +### v0.169.1 — Disk-health card: exclude logical/network storage (2026-07-24) + +Live QA follow-up to v0.169.0: the agent defaults SMART to UNKNOWN on non-physical targets (PBS, +LVM-thin), so they appeared in the "Lemezek állapota" card as spurious "Nincs adat" rows. +`isPhysicalDisk` now excludes `pbs`/`lvmthin`/`nfs`/`cifs` by type (applies to both the card and the +6h check). Test strengthened: a PBS/LVM fixture carrying UNKNOWN SMART must still be excluded. + ### v0.169.0 — Disk-health card + degradation notification ("Lemezek állapota") (2026-07-24) Consumes the agent's new `smart` payload field (agent **v0.94.0**); **MinAgent floor unchanged** — the diff --git a/controller/internal/web/disk_health.go b/controller/internal/web/disk_health.go index 36348e4..5481510 100644 --- a/controller/internal/web/disk_health.go +++ b/controller/internal/web/disk_health.go @@ -62,9 +62,14 @@ func (s *Server) fetchDisks(ctx context.Context) (agentapi.DisksResponse, error) return client.Disks(ctx) } -// isPhysicalDisk reports whether a target is a physical disk SMART applies to (has a backing device -// or a serialized SMART summary). pbs/lvm/nfs targets are excluded from the disk-health view. +// isPhysicalDisk reports whether a target is a physical disk SMART applies to. Logical/network +// storage (PBS, LVM-thin, NFS, CIFS) is excluded even though the agent may default its SMART to +// UNKNOWN — those are storage abstractions, not disks, and must not clutter the disk-health card. func isPhysicalDisk(d agentapi.DiskInfo) bool { + switch d.Type { + case "pbs", "lvmthin", "nfs", "cifs": + return false + } return d.BackingDevice != "" || d.Smart != nil } diff --git a/controller/internal/web/disk_health_test.go b/controller/internal/web/disk_health_test.go index 5d3c261..f735556 100644 --- a/controller/internal/web/disk_health_test.go +++ b/controller/internal/web/disk_health_test.go @@ -112,12 +112,14 @@ func TestDiskHealthRows_NilSmart(t *testing.T) { s, _, payload := diskCheckHarness(t) *payload = []agentapi.DiskInfo{ {Name: "sdb", BackingDevice: "/dev/sdb", Smart: nil}, // physical, no smart → Nincs adat - {Name: "felhom-pbs", Type: "pbs"}, // non-physical → excluded + // PBS/LVM carry a default UNKNOWN SMART from the agent — must STILL be excluded (not disks). + {Name: "felhom-pbs", Type: "pbs", Smart: &agentapi.SmartSummary{Health: agentapi.SmartUnknown}}, + {Name: "local-lvm", Type: "lvmthin", Smart: &agentapi.SmartSummary{Health: agentapi.SmartUnknown}}, {Name: "sdc", BackingDevice: "/dev/sdc", Smart: &agentapi.SmartSummary{Health: agentapi.SmartPassed, TemperatureC: smartPtr(31)}}, // Rendben, 31°C } rows := s.diskHealthRows(context.Background()) if len(rows) != 2 { - t.Fatalf("want 2 physical-disk rows (pbs excluded), got %d: %+v", len(rows), rows) + t.Fatalf("want 2 physical-disk rows (pbs+lvm excluded), got %d: %+v", len(rows), rows) } byLabel := map[string]DiskHealthRow{} for _, r := range rows {