Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Sources/ContainerBuild/BuildImageResolver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ struct BuildImageResolver: BuildPipelineHandler {
defer { progress.finish() }
progress.start()

guard let img = try? await ClientImage.pull(reference: ref, platform: platform, progressUpdate: progress.handler) else {
return try await ClientImage.fetch(reference: ref, platform: platform, progressUpdate: progress.handler)
}
return img
// Use fetch() which checks cache first, then pulls if needed
return try await ClientImage.fetch(reference: ref, platform: platform, progressUpdate: progress.handler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch() only retrieves the manifest if needed, doesn't it?

I don't see how this actually pulls content. The code before the original progress bar changed looked like:

           guard let img = try? await ClientImage.pull(reference: ref, platform: platform) else {
                return try await ClientImage.fetch(reference: ref, platform: platform)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code was backwards. fetch() tries to get the image from the local cache first, and if not found, it calls pull().

}()

let index: Index = try await img.index()
Expand Down