mirror of
https://github.com/apple/container.git
synced 2026-07-15 05:57:01 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user