From 7efc0f371bc18bfb578a99fb83c353addced705f Mon Sep 17 00:00:00 2001 From: Aditya Ramani Date: Tue, 10 Jun 2025 16:07:01 -0700 Subject: [PATCH] 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 --- .../ContainerImagesService/Server/SnapshotStore.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift b/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift index a5f7e927..40236d02 100644 --- a/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift +++ b/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift @@ -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 {