Merge main into ai-features: incorporate latest bugfixes

Resolved conflicts:
- pkg/fsfilters/filters.go: Keep both TrueNAS and EnhanceCP filter fixes
- DockerUnifiedTable.tsx: Use main's resource column overlap fix
This commit is contained in:
rcourtman 2025-12-13 15:18:51 +00:00
commit e27b6f2657
4 changed files with 29 additions and 17 deletions

View file

@ -1401,12 +1401,9 @@ const DockerContainerRow: Component<{
<For each={DOCKER_COLUMNS}>
{(column) => (
<td
class="py-0.5 align-middle whitespace-nowrap"
class={`py-0.5 align-middle whitespace-nowrap ${column.id === 'resource' ? 'max-w-[300px]' : ''}`}
style={{
"min-width": column.id === 'cpu' || column.id === 'memory' ? '140px' : undefined,
// Force resource column to respect truncation for very long names (issue #789)
"max-width": column.id === 'resource' ? '0' : undefined,
"width": column.id === 'resource' ? '25%' : undefined,
}}
>
{renderCell(column)}
@ -2231,12 +2228,9 @@ const DockerServiceRow: Component<{
<For each={DOCKER_COLUMNS}>
{(column) => (
<td
class="py-0.5 align-middle whitespace-nowrap"
class={`py-0.5 align-middle whitespace-nowrap ${column.id === 'resource' ? 'max-w-[300px]' : ''}`}
style={{
"min-width": column.id === 'cpu' || column.id === 'memory' ? '140px' : undefined,
// Force resource column to respect truncation for very long names (issue #789)
"max-width": column.id === 'resource' ? '0' : undefined,
"width": column.id === 'resource' ? '25%' : undefined,
}}
>
{renderCell(column)}

View file

@ -14740,7 +14740,6 @@ func TestLoadActiveAlerts(t *testing.T) {
t.Run("skips old alerts", func(t *testing.T) {
m := newTestManager(t)
m.ClearActiveAlerts()
// Create an old alert (>24 hours)
startTime := time.Now().Add(-25 * time.Hour)
@ -14761,8 +14760,10 @@ func TestLoadActiveAlerts(t *testing.T) {
// Save to disk
_ = m.SaveActiveAlerts()
// Clear and reload
m.ClearActiveAlerts()
// Clear in-memory map only (don't use ClearActiveAlerts which triggers async save)
m.mu.Lock()
m.activeAlerts = make(map[string]*Alert)
m.mu.Unlock()
err := m.LoadActiveAlerts()
if err != nil {
@ -14780,7 +14781,6 @@ func TestLoadActiveAlerts(t *testing.T) {
t.Run("skips old acknowledged alerts", func(t *testing.T) {
m := newTestManager(t)
m.ClearActiveAlerts()
// Create an alert acknowledged >1 hour ago
startTime := time.Now().Add(-30 * time.Minute)
@ -14805,8 +14805,10 @@ func TestLoadActiveAlerts(t *testing.T) {
// Save to disk
_ = m.SaveActiveAlerts()
// Clear and reload
m.ClearActiveAlerts()
// Clear in-memory map only (don't use ClearActiveAlerts which triggers async save)
m.mu.Lock()
m.activeAlerts = make(map[string]*Alert)
m.mu.Unlock()
err := m.LoadActiveAlerts()
if err != nil {
@ -14824,7 +14826,6 @@ func TestLoadActiveAlerts(t *testing.T) {
t.Run("restores acknowledgment state", func(t *testing.T) {
m := newTestManager(t)
m.ClearActiveAlerts()
// Create an acknowledged alert
startTime := time.Now().Add(-10 * time.Minute)
@ -14849,8 +14850,11 @@ func TestLoadActiveAlerts(t *testing.T) {
// Save to disk
_ = m.SaveActiveAlerts()
// Clear and reload
m.ClearActiveAlerts()
// Clear in-memory maps only (don't use ClearActiveAlerts which triggers async save)
m.mu.Lock()
m.activeAlerts = make(map[string]*Alert)
m.ackState = make(map[string]ackRecord)
m.mu.Unlock()
err := m.LoadActiveAlerts()
if err != nil {

View file

@ -170,5 +170,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
}

View file

@ -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},
// TrueNAS SCALE Docker overlay paths (issue #718)
{"truenas ix-apps docker overlay2", "zfs", "/mnt/.ix-apps/docker/overlay2/6c9aad59ec9b0bc33d5e374/merged", 173 * 1024 * 1024 * 1024 * 1024, 399 * 1024 * 1024, true},