Skip to content

Network: Move to standalone type#584

Open
dcantah wants to merge 1 commit intoapple:mainfrom
dcantah:move-vmnet-network
Open

Network: Move to standalone type#584
dcantah wants to merge 1 commit intoapple:mainfrom
dcantah:move-vmnet-network

Conversation

@dcantah
Copy link
Member

@dcantah dcantah commented Mar 14, 2026

The network protocol and VMNetNetwork implementation currently are housed on ContainerManager even though they are generally useful types even outside of this easy to use helper type. This change moves them to not be nested types anymore, as well as exposes a new param on VMNetNetworks constructor so we can pass the type of network.


/// Returns a new interface for use with a container.
/// - Parameter id: The container ID.
public mutating func create(_ id: String) throws -> Containerization.Interface? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems odd that we define the protocol and this conforms to it, and then we've got a couple extra create functions that don't.

I guess the question here is: what's the point of having a protocol.

Copy link
Member Author

@dcantah dcantah Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's so ContainerManager can take in anything, and poop out Interface's. But for the more "in control" types like LinuxContainer you can call any of these. ContainerManager is meant to fulfill the very simplest use cases.

The network protocol and VMNetNetwork implementation currently are
housed on ContainerManager even though they are generally useful
types even outside of this easy to use helper type. This change moves
them to not be nested types anymore, as well as exposes a new param
on VMNetNetworks constructor so we can pass the type of network.
@dcantah dcantah force-pushed the move-vmnet-network branch from b603c73 to 9644e61 Compare March 17, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants