Skip to content

Commit 88a473e

Browse files
authored
Fix progress bar crash on cached image rebuilds (#894)
- Fixes #883. Changes `BuildImageResolver` to use `fetch()` instead of `pull()`. `fetch()` checks the cache first and only pulls if needed, preventing incorrect progress events (e.g., "1/1 KB" metadata checks) on cached images that caused the progress bar width calculation to produce negative/weird padding counts, triggering "Fatal error: Negative count not allowed" crashes during rebuilds.
1 parent 87b5623 commit 88a473e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/ContainerBuild/BuildImageResolver.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,8 @@ struct BuildImageResolver: BuildPipelineHandler {
7272
defer { progress.finish() }
7373
progress.start()
7474

75-
guard let img = try? await ClientImage.pull(reference: ref, platform: platform, progressUpdate: progress.handler) else {
76-
return try await ClientImage.fetch(reference: ref, platform: platform, progressUpdate: progress.handler)
77-
}
78-
return img
75+
// Use fetch() which checks cache first, then pulls if needed
76+
return try await ClientImage.fetch(reference: ref, platform: platform, progressUpdate: progress.handler)
7977
}()
8078

8179
let index: Index = try await img.index()

0 commit comments

Comments
 (0)