mirror of
https://github.com/apple/container.git
synced 2026-10-13 17:49:16 +00:00
I've extracted the network cleanup step from `delete` into a new public `releaseNetwork` method. This mirrors the existing `release` on `VmnetNetwork` and enables stop-and-restart workflows where the network allocation needs to be freed without removing the container's rootfs. ## Changes - Add `ContainerManager.release(_:)` — frees network resources for a container after it has stopped - Refactor `delete(_:)` to call `releaseNetwork(_:)` before removing files, preserving existing behavior ## Motivation Currently the only way to free a container's network allocation is `delete`, which also removes its files. This makes it impossible to stop a container (freeing the network so the ID can be re-allocated) and later restart it with its filesystem intact. The new `releaseNetwork ` method fills this gap.