Open
Conversation
jglogan
reviewed
Mar 17, 2026
|
|
||
| /// Returns a new interface for use with a container. | ||
| /// - Parameter id: The container ID. | ||
| public mutating func create(_ id: String) throws -> Containerization.Interface? { |
Contributor
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
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.
b603c73 to
9644e61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.