instancectl: the removal guard owns the policy paths' raw removals (merge follow-up)
Main's rootfs removal guard (rootfs apps plan 2) lists every function that may make a raw removal. The branch's persistDueLocked (a host slice's egress due file) and removeGenControlDropIn (a binary generation's control drop-in) each remove only their own files; genControlDropIn never names a rootfs unit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+6
−1
internal/instancectl/rootfs_removal_guard_test.go+6 −1
CI failed — run details
diff --git a/internal/instancectl/rootfs_removal_guard_test.go b/internal/instancectl/rootfs_removal_guard_test.go| index 3acd0ffd1..8165f127f 100644 |
| --- a/internal/instancectl/rootfs_removal_guard_test.go |
| +++ b/internal/instancectl/rootfs_removal_guard_test.go |
| @@ -89,13 +89,18 @@ var ( |
| // and the claim launch path's owners of its own files (prepareExecGate: |
| // the old exec socket once the old unit is proven stopped; clearLaunch: |
| // the claim launch drop-in, launch.json, permit.json and exec.sock once |
| - // the unit is proven empty), which the safefile rule reaches. |
| + // the unit is proven empty), which the safefile rule reaches, and the |
| + // policy paths' owners of their own files (#328, #329: persistDueLocked, |
| + // a host slice's egress due file and its empty directory; |
| + // removeGenControlDropIn, a binary generation unit's control drop-in |
| + // directory, which genControlDropIn never names for a rootfs unit). |
| rawRemovalOwners = map[string]bool{ |
| "removeRootfsExe": true, "removeWorkerFiles": true, "removeRootfsGenFiles": true, "removeJITDropIn": true, |
| "removeGenFiles": true, "removeSharedKeyDir": true, "removeEntry": true, "removeTree": true, |
| "removeCmdExe": true, "ensureExeAs": true, "replaceLink": true, |
| "writeFileExcl": true, "BuildProbeImage": true, "bindControlSocket": true, |
| "prepareExecGate": true, "clearLaunch": true, |
| + "persistDueLocked": true, "removeGenControlDropIn": true, |
| } |
| // rawRemovals: import path -> the functions of that package that remove. |
| rawRemovals = map[string]map[string]bool{ |