mirror of
https://github.com/apple/container.git
synced 2026-10-14 18:19:17 +00:00
This change adds support for attaching network block device (NBD) to both LinuxContainer and LinuxPod. For LinuxContainer, whether to use the underlying `VZNetworkBlockDeviceStorageDeviceAttachment` is determined by the URL of the container Mount source. For LinuxPod, adds additional API to support pod-level volumes that can be mounted into multiple containers. The PodVolume type provides enum to support multiple types of volume source. LinuxContainer can reference the pod level volume using the `Mount.sharedMount()` constructor with the name referencing the name of the pod volume. This will allow the NBD to be attached to the pod at the VM level and then bind-mounted into the container. For integration tests, added a lightweight NBD server implementation in swift that speaks the NBD protocol to ensure there is sufficient coverage for the changes introduced. Apple Virtualization NBD support documentation: https://developer.apple.com/documentation/virtualization/vznetworkblockdevicestoragedeviceattachment