agent v0.34.0: intermediary mount model — shared parent + host-side attach/detach + reconcile

Replaces the per-drive 'pct set -mpN' bind with ONE permanent parent bind
/mnt/felhom-drives plus host-side felhom-data swaps underneath it (propagates
into the running guest live, no pct, no reboot; C1-immune; confined; fail-closed
when absent). EnsureSharedParent installs a boot unit ordered Before=pve-guests.
ReassertGuestBinds is now a pure host-side reconcile. /disks reports GuestPath +
BoundUnderParent for the controller repoint+gate. Non-hollow tests + companions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 16:29:32 +02:00
parent 44cdf82631
commit 3a9be73875
11 changed files with 528 additions and 131 deletions
+9 -6
View File
@@ -169,8 +169,8 @@ func TestReassertGuestBinds_SkipsDecommissioned(t *testing.T) {
8200: {"mp0": "local-lvm:8,mp=/var/lib/docker"}, // bind missing → would re-add if not gated
})
srvD.ReassertGuestBinds(context.Background())
if gaD.count() != 0 {
t.Fatalf("decommissioned drive was re-bound (%d AttachBind) — intent gate missing", gaD.count())
if gaD.attachDriveCount() != 0 {
t.Fatalf("decommissioned drive was re-bound (%d AttachDrive) — intent gate missing", gaD.attachDriveCount())
}
// companion: enrolled → DOES rebind (same present drive + missing bind).
@@ -183,8 +183,11 @@ func TestReassertGuestBinds_SkipsDecommissioned(t *testing.T) {
8200: {"mp0": "local-lvm:8,mp=/var/lib/docker"},
})
srvE.ReassertGuestBinds(context.Background())
if gaE.count() != 1 {
t.Fatalf("enrolled drive should rebind (got %d AttachBind) — gate too aggressive", gaE.count())
if gaE.attachDriveCount() != 1 {
t.Fatalf("enrolled drive should rebind (got %d AttachDrive) — gate too aggressive", gaE.attachDriveCount())
}
if gaE.attachDrives[0] != "/mnt/felhom-usb" {
t.Fatalf("reconcile bound the wrong path: %v", gaE.attachDrives)
}
}
@@ -208,8 +211,8 @@ func TestReCommission_ReRecords(t *testing.T) {
8200: {"mp0": "local-lvm:8,mp=/var/lib/docker"},
})
srv.ReassertGuestBinds(context.Background())
if ga.count() != 1 {
t.Fatalf("re-commissioned drive should rebind (got %d)", ga.count())
if ga.attachDriveCount() != 1 {
t.Fatalf("re-commissioned drive should rebind under the parent (got %d AttachDrive)", ga.attachDriveCount())
}
}