Skip to content

Commit 3720196

Browse files
cleanup
1 parent 75fa939 commit 3720196

4 files changed

Lines changed: 0 additions & 16 deletions

File tree

Sources/ContainerCommands/Container/ContainerCopy.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ extension Application {
6363
let dstRef = try Self.parsePathRef(destination)
6464

6565
switch (srcRef, dstRef) {
66-
// `-` is an uncompressed tar stream on stdin/stdout, matching
67-
// `docker cp` and `podman cp`. The descriptor is handed to the
68-
// runtime and forwarded to the guest unmodified: nothing is staged
69-
// on the host, so host permission rules and path length limits do
70-
// not apply, and the ownership and mode recorded in the tar headers
71-
// are what land in the container. Neither case prints, so stdout
72-
// carries only archive bytes.
7366
case (.container(let id, let path), .local("-")):
7467
try await client.copyOut(id: id, source: path, archive: FileHandle.standardOutput)
7568
case (.local("-"), .container(let id, let path)):

Sources/Services/ContainerAPIService/Server/Containers/ContainersHarness.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,6 @@ public struct ContainersHarness: Sendable {
311311
}
312312
let createParents = message.bool(key: .createParents)
313313

314-
// fileHandle(key:) hands back a duplicate this process owns, so close it
315-
// however the copy ends. The container lookups underneath can throw
316-
// before the descriptor is ever forwarded.
317314
if let archive = message.fileHandle(key: .archiveFd) {
318315
defer { try? archive.close() }
319316
try await service.copyIn(id: id, archive: archive, destination: destinationPath, createParents: createParents)

Sources/Services/RuntimeLinux/Server/RuntimeService.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,6 @@ public actor RuntimeService {
706706
}
707707
let createParents = message.bool(key: RuntimeKeys.createParents.rawValue)
708708

709-
// A tar stream fd replaces the host source path: the bytes go
710-
// straight to the guest, which extracts them honoring the ownership
711-
// and mode in the tar headers.
712709
if let archive = message.fileHandle(key: RuntimeKeys.archiveFd.rawValue) {
713710
defer { try? archive.close() }
714711
let ctr = try getContainer()
@@ -766,8 +763,6 @@ public actor RuntimeService {
766763
message: "no source path supplied for copyOut"
767764
)
768765
}
769-
// A tar stream fd replaces the host destination path: the guest
770-
// archives the source and the bytes are written straight out.
771766
if let archive = message.fileHandle(key: RuntimeKeys.archiveFd.rawValue) {
772767
defer { try? archive.close() }
773768
let ctr = try getContainer()

Tests/IntegrationTests/Containers/TestCLICopyCommand.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ struct TestCLICopyCommand {
197197
let result = try f.run(["copy", "\(name):/tmp/tarout.txt", "-"])
198198
try result.check("stdout tar stream copy failed")
199199

200-
// Plain tar, not gzip: docker emits an uncompressed stream.
201200
#expect(result.outputData.prefix(2) != Data([0x1f, 0x8b]), "stdout stream is gzip compressed")
202201

203202
let entries = try readTarStream(result.outputData)

0 commit comments

Comments
 (0)