Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Services/ContainerAPIService/Client/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public struct Parser {
}
var directives = defaultDirectives
for part in parts {
let keyVal = part.split(separator: "=", maxSplits: 2)
let keyVal = part.split(separator: "=", maxSplits: 1)
var key = String(keyVal[0])
var skipValue = false
switch key {
Expand Down
20 changes: 20 additions & 0 deletions Tests/ContainerAPIClientTests/ParserTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,26 @@ struct ParserTest {
}
}

@Test
func testMountBindSourceContainingEquals() throws {
let tempDir = FileManager.default.temporaryDirectory.appendingPathComponent("test-bind-eq-\(UUID().uuidString)=v1")
try FileManager.default.createDirectory(at: tempDir, withIntermediateDirectories: true)
defer {
try? FileManager.default.removeItem(at: tempDir)
}

let result = try Parser.mount("type=bind,src=\(tempDir.path),dst=/foo")

switch result {
case .filesystem(let fs):
#expect(fs.source == tempDir.path)
#expect(fs.destination == "/foo")
#expect(!fs.isVolume)
case .volume:
#expect(Bool(false), "Expected filesystem mount, got volume")
}
}

@Test
func testMountVolumeValidName() throws {
let result = try Parser.mount("type=volume,src=myvolume,dst=/data")
Expand Down