Skip to content

Commit 11ea55d

Browse files
Merge branch 'main' into bug-copy
2 parents 6e1acf2 + 371db6d commit 11ea55d

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

Sources/ContainerResource/Network/NetworkMode.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
// limitations under the License.
1515
//===----------------------------------------------------------------------===//
1616

17-
import ArgumentParser
18-
1917
/// Networking mode that applies to client containers.
20-
public enum NetworkMode: String, Codable, Sendable, ExpressibleByArgument {
18+
public enum NetworkMode: String, Codable, Sendable {
2119
/// NAT networking mode.
2220
/// Containers do not have routable IPs, and the host performs network
2321
/// address translation to allow containers to reach external services.

Sources/Helpers/NetworkVmnet/NetworkVmnetHelper+Start.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ enum Variant: String, ExpressibleByArgument {
2929
case allocationOnly
3030
}
3131

32+
extension NetworkMode: ExpressibleByArgument {}
33+
3234
extension NetworkVmnetHelper {
3335
struct Start: AsyncParsableCommand {
3436
static let configuration = CommandConfiguration(

Tests/CLITests/Subcommands/Containers/TestCLIExec.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,15 @@ class TestCLIExecCommand: CLITest {
122122
do {
123123
_ = try doExec(name: name, cmd: ["sleep", "infinity"])
124124
} catch CLIError.executionFailed(let message) {
125-
#expect(message.contains("is not running"))
125+
// There's no nice way to check fail reason here
126+
#expect(message.contains("is not running"), "expected container is not running if exec failed")
127+
}
128+
129+
// Give time for the exec (or start) error handling settles down
130+
sleep(1)
131+
#expect(throws: Never.self, "expected the container remains") {
132+
try getContainerStatus(name)
126133
}
127-
#expect(try getContainerStatus(name) == "stopped")
128134
}
129135
}
130136
}

0 commit comments

Comments
 (0)