From 38294d4eb5858e337b990b4239f96e760e47baa2 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Mon, 15 Jun 2026 16:54:33 +0200 Subject: [PATCH] controller v0.67.1: gate only acts on external drives under /mnt/felhom-drives/ Fix caught live: planDriveGates falsely marked the internal SSD path /mnt/sys_drive/felhom-data disconnected (agent never reports it), which would block starting SSD-resident apps. Gate now skips non-/mnt/felhom-drives/ paths. Regression case added. No apps were stopped (none depended on the SSD path). Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 8 ++++++++ controller/internal/web/intermediary.go | 8 ++++++++ controller/internal/web/intermediary_test.go | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da62598..3c5f2a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ## Changelog +### v0.67.1 — gate: only act on external drives under /mnt/felhom-drives/ (2026-06-15) + +Fix (caught live on the v0.67.0 deploy): `planDriveGates` marked the internal SSD path +`/mnt/sys_drive/felhom-data` "disconnected" because the agent never reports it as a drive — which would +have blocked starting SSD-resident apps. The gate now only considers EXTERNAL drives registered under +the stable parent `/mnt/felhom-drives/`; always-present SSD/system paths are skipped. Regression +case added to `TestPlanDriveGates`. (No apps were stopped — no app depended on the SSD path.) + ### v0.67.0 — intermediary-mount: HDD_PATH repoint + drive-absent gate + H1 routes (2026-06-15) Controller half of the intermediary-mount re-architecture (pairs with agent v0.34.0). Drives are now diff --git a/controller/internal/web/intermediary.go b/controller/internal/web/intermediary.go index aa684ba..b19bce6 100644 --- a/controller/internal/web/intermediary.go +++ b/controller/internal/web/intermediary.go @@ -105,6 +105,14 @@ func planDriveGates(paths []settings.StoragePath, disks []agentapi.DiskInfo) []g if sp.Decommissioned { continue } + // ONLY gate EXTERNAL drives — those registered under the stable parent /mnt/felhom-drives/. + // Internal SSD / system paths (e.g. /mnt/sys_drive/felhom-data) are always-present locals the agent + // never reports as drives; gating them on "absence" would falsely stop/block their apps. (Legacy + // raw /mnt/ external paths are present via the agent's MountPath during the transition and get + // repointed under the parent by the migration.) + if !strings.HasPrefix(sp.Path, StableParentDir+"/") { + continue + } switch { case !present[sp.Path] && !sp.Disconnected: actions = append(actions, gateAction{Path: sp.Path, Stop: true}) diff --git a/controller/internal/web/intermediary_test.go b/controller/internal/web/intermediary_test.go index 52db59e..4f06166 100644 --- a/controller/internal/web/intermediary_test.go +++ b/controller/internal/web/intermediary_test.go @@ -38,6 +38,7 @@ func TestPlanDriveGates(t *testing.T) { {Path: "/mnt/felhom-drives/back", Disconnected: true}, // present + disconnected → RETURN {Path: "/mnt/felhom-drives/gone", Disconnected: true}, // ABSENT + disconnected → no action (steady) {Path: "/mnt/felhom-drives/dead", Decommissioned: true}, // decommissioned → never touched + {Path: "/mnt/sys_drive/felhom-data"}, // INTERNAL SSD (absent from agent) → never gated } disks := []agentapi.DiskInfo{ {MountPath: "/mnt/usb", GuestPath: "/mnt/felhom-drives/usb", State: "attached"}, @@ -66,4 +67,7 @@ func TestPlanDriveGates(t *testing.T) { if _, acted := actions["/mnt/felhom-drives/dead"]; acted { t.Errorf("decommissioned drive must never be gated") } + if _, acted := actions["/mnt/sys_drive/felhom-data"]; acted { + t.Errorf("internal SSD/system path must NEVER be gated (only /mnt/felhom-drives/ externals)") + } }