fix: Filter EnhanceCP /var/container_tmp overlay mounts from disk stats
EnhanceCP uses /var/container_tmp/{uuid}/merged for container overlays.
These are ephemeral container layers, not user storage, and should be
filtered from disk usage display. Related to #790
This commit is contained in:
parent
77e59afe14
commit
734b369500
2 changed files with 14 additions and 0 deletions
|
|
@ -155,5 +155,16 @@ func ShouldSkipFilesystem(fsType, mountpoint string, totalBytes, usedBytes uint6
|
|||
}
|
||||
}
|
||||
|
||||
// EnhanceCP uses /var/container_tmp/{uuid}/merged for container overlays.
|
||||
// Filter these as they're ephemeral container layers, not user storage. Related to #790.
|
||||
if strings.Contains(mountpoint, "/container_tmp/") {
|
||||
for _, pattern := range containerOverlayPatterns {
|
||||
if strings.Contains(mountpoint, pattern) {
|
||||
reasons = append(reasons, "container-overlay")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return len(reasons) > 0, reasons
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,6 +179,9 @@ func TestShouldSkipFilesystem(t *testing.T) {
|
|||
{"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},
|
||||
// EnhanceCP container_tmp paths (issue #790)
|
||||
{"enhancecp container_tmp merged", "overlay", "/var/container_tmp/0d6eaae4-1aa0-4aad-a9d9-d430329c2e38/merged", 1000000, 500000, true},
|
||||
{"enhancecp container_tmp overlay", "overlay", "/var/container_tmp/abc123/overlay/layer", 1000000, 500000, true},
|
||||
|
||||
// Windows paths
|
||||
{"Windows System Reserved", "NTFS", "System Reserved", 500 * 1024 * 1024, 100 * 1024 * 1024, true},
|
||||
|
|
|
|||
Loading…
Reference in a new issue