Skip unpacking unsupported platforms (#127)

This is a more appropriate fix for
https://github.com/apple/container/issues/61 - which was closed by use
of a workaround.
There is no need to unpack image variants that we dont support.

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
This commit is contained in:
Aditya Ramani
2025-06-10 16:07:01 -07:00
committed by GitHub
parent f4383d78dd
commit 7efc0f371b
@@ -62,6 +62,9 @@ public actor SnapshotStore {
guard let platform = desc.platform else {
throw ContainerizationError(.internalError, message: "Missing platform for descriptor \(desc.digest)")
}
guard Self.shouldUnpackPlatform(platform) else {
continue
}
let currentSubTask = await taskManager.startTask()
if let progressUpdate {
let _taskUpdateProgress = ProgressTaskCoordinator.handler(for: currentSubTask, from: progressUpdate)
@@ -183,6 +186,13 @@ public actor SnapshotStore {
try self.fm.createDirectory(at: uniqueDirectoryURL, withIntermediateDirectories: true, attributes: nil)
return uniqueDirectoryURL
}
private static func shouldUnpackPlatform(_ platform: Platform) -> Bool {
guard platform.os == "linux" else {
return false
}
return true
}
}
extension FileManager {