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) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 16:54:33 +02:00
parent 55c896624f
commit 38294d4eb5
3 changed files with 20 additions and 0 deletions
+8
View File
@@ -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/<name>.
// 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/<name> 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})
@@ -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)")
}
}