Skip to content

Commit a18f490

Browse files
Fix user arg passthrough for container create
Signed-off-by: Kathryn Baldauf <[email protected]>
1 parent 837ef61 commit a18f490

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ integration: init-block
138138
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLINetwork
139139
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIRunLifecycle
140140
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIExecCommand
141+
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLICreateCommand
141142
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIRunCommand
142143
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIImagesCommand
143144
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIRunBase

Sources/CLI/Container/ContainerCreate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extension Application {
2929
@Argument(help: "Image name")
3030
var image: String
3131

32-
@Argument(help: "Container init process arguments")
32+
@Argument(parsing: .captureForPassthrough, help: "Container init process arguments")
3333
var arguments: [String] = []
3434

3535
@OptionGroup
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Foundation
2+
import Testing
3+
4+
class TestCLICreateCommand: CLITest {
5+
@Test func testCreateArgsPassthrough() throws {
6+
let name: String! = Test.current?.name.trimmingCharacters(in: ["(", ")"])
7+
#expect(throws: Never.self, "expected container create to succeed") {
8+
try doCreate(name: name, args: ["echo", "-n", "hello", "world"])
9+
try doRemove(name: name)
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)