From b2053d46fce3f45bdc199a723b1086435b42f138 Mon Sep 17 00:00:00 2001 From: Jaewon Hur Date: Fri, 7 Aug 2026 09:55:25 -0700 Subject: [PATCH] Return nil if no local image of matching label found --- .../Services/ContainerAPIService/Client/ClientImage.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Sources/Services/ContainerAPIService/Client/ClientImage.swift b/Sources/Services/ContainerAPIService/Client/ClientImage.swift index 3516d0ef9..72d7745d9 100644 --- a/Sources/Services/ContainerAPIService/Client/ClientImage.swift +++ b/Sources/Services/ContainerAPIService/Client/ClientImage.swift @@ -185,7 +185,7 @@ extension ClientImage { public static func get(reference: String, containerSystemConfig: ContainerSystemConfig) async throws -> ClientImage { let all = try await self.list() guard let found = try self._search(reference: reference, in: all, containerSystemConfig: containerSystemConfig) else { - throw ContainerizationError(.notFound, message: "image with reference \(reference)") + throw ContainerizationError(.notFound, message: "image with reference \(reference) not found") } return found } @@ -226,10 +226,6 @@ extension ClientImage { let withDefaultTag = r.description let localImageMatches = all.filter { $0.description.nameFromAnnotation() == withDefaultTag } - guard localImageMatches.count > 1 else { - return localImageMatches.first - } - // More than one image matched. Check against the tagged reference return localImageMatches.first { $0.reference == withDefaultTag } }() if let locallyBuiltImage {