Skip to content

Commit

Permalink
Merge pull request #2318 from buildpacks/jjbustamante/fix-pack-2315
Browse files Browse the repository at this point in the history
Update hardcoded error message to pull images without architecture
  • Loading branch information
jjbustamante authored Jan 15, 2025
2 parents 2f1af85 + a2c2365 commit 0adeb45
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/image/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@ func (f *Fetcher) Fetch(ctx context.Context, name string, options FetchOptions)
// FIXME: this matching is brittle and the fallback should be removed when https://github.com/buildpacks/pack/issues/2079
// has been fixed for a sufficient amount of time.
// Sample error from docker engine:
// `image with reference <image> was found but does not match the specified platform: wanted linux/amd64, actual: linux`
if strings.Contains(err.Error(), "does not match the specified platform") &&
(strings.HasSuffix(strings.TrimSpace(err.Error()), "actual: linux") ||
strings.HasSuffix(strings.TrimSpace(err.Error()), "actual: windows")) {
// `image with reference <image> was found but does not match the specified platform: wanted linux/amd64, actual: linux` or
// `image with reference <image> was found but its platform (linux) does not match the specified platform (linux/amd64)`
if strings.Contains(err.Error(), "does not match the specified platform") {
f.logger.Debugf(fmt.Sprintf("Pulling image %s", style.Symbol(name)))
err = f.pullImage(ctx, name, "")
}
Expand Down

0 comments on commit 0adeb45

Please sign in to comment.