Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

fix: Filter container overlay mounts in non-standard locations

rcourtman4c989331755f
diff --git a/pkg/fsfilters/filters.go b/pkg/fsfilters/filters.go
index 93f2fc7189..8d6b9a40c9 100644
--- a/pkg/fsfilters/filters.go
+++ b/pkg/fsfilters/filters.go
@@ -86,9 +86,21 @@ var specialMountPrefixes = []string{
"/sys",
"/run",
"/var/lib/docker",
+ "/var/lib/containers",
"/snap",
}
+// containerOverlayPatterns detect container overlay filesystem paths from various
+// container runtimes (Docker, Podman, LXC, EnhanceCP, etc.) that may not be in
+// standard locations. These paths should be excluded from disk usage as they
+// represent container layers, not actual storage usage.
+var containerOverlayPatterns = []string{
+ "/overlay2/",
+ "/overlay/",
+ "/diff/",
+ "/merged",
+}
+
// ShouldSkipFilesystem determines if a filesystem should be excluded from disk
// usage aggregation. It checks for read-only filesystems, virtual/pseudo filesystems,
// network mounts, and special system mountpoints. Returns skip=true if the filesystem
@@ -132,5 +144,16 @@ func ShouldSkipFilesystem(fsType, mountpoint string, totalBytes, usedBytes uint6
reasons = append(reasons, "special-mountpoint")
}
+ // Check for container overlay paths from various runtimes in non-standard locations
+ // (e.g., /var/local/enhance/containers/*/overlay/merged). Related to #790.
+ if strings.Contains(mountpoint, "/containers/") {
+ for _, pattern := range containerOverlayPatterns {
+ if strings.Contains(mountpoint, pattern) {
+ reasons = append(reasons, "container-overlay")
+ break
+ }
+ }
+ }
+
return len(reasons) > 0, reasons
}
diff --git a/pkg/fsfilters/filters_test.go b/pkg/fsfilters/filters_test.go
index 7ee28cb455..4af2622191 100644
--- a/pkg/fsfilters/filters_test.go
+++ b/pkg/fsfilters/filters_test.go
@@ -173,6 +173,12 @@ func TestShouldSkipFilesystem(t *testing.T) {
{"/var/lib/docker", "ext4", "/var/lib/docker/overlay2", 1000000, 500000, true},
{"/snap prefix", "ext4", "/snap/core/12345", 1000000, 500000, true},
{"/boot/efi exact", "vfat", "/boot/efi", 512 * 1024 * 1024, 50 * 1024 * 1024, true},
+ {"/var/lib/containers podman", "ext4", "/var/lib/containers/storage/overlay/abc123/merged", 1000000, 500000, true},
+
+ // Container overlay paths in non-standard locations (issue #790)
+ {"enhance containers overlay", "ext4", "/var/local/enhance/containers/abc123/overlay/merged", 1000000, 500000, true},
+ {"custom containers diff", "ext4", "/opt/containers/myapp/diff/layer", 1000000, 500000, true},
+ {"custom containers overlay2", "ext4", "/data/containers/xyz/overlay2/layer1", 1000000, 500000, true},
// Windows paths
{"Windows System Reserved", "NTFS", "System Reserved", 500 * 1024 * 1024, 100 * 1024 * 1024, true},