-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update hardcoded error message to pull images without architecture #2318
Conversation
… in a registry by platform Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2318 +/- ##
==========================================
- Coverage 70.00% 70.00% -0.00%
==========================================
Files 254 254
Lines 18721 18720 -1
==========================================
- Hits 13104 13103 -1
Misses 4741 4741
Partials 876 876
Flags with carried forward coverage won't be shown. Click here to find out more. |
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") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant as a quick fix? Because it would break again if docker decides to change the wording. But a quick fix would be highly appreciated since this is really critical for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! I can take a look later and try to find a better solution, but I wanted to unblock end-users with it
@c0d1ngm0nk3y Could you verify the binary and check if it solves your bug? |
Will this trigger another release? |
Yes! I also want to include ticket #2299! I left you a message there 😄, if we can verify that fix, I will release |
Summary
When the
--platform
flag was released, we wanted to keep compatibility with old buildpacks wherearchitecture
was not specified, we also didn't want to add an overhead on trying to pull an image when it doesn't exist in the registry.The way we did it was to parse the error message returned by the pulling operation and try to match some strings, the message was
changed
in the upstream docker dependency and this ticket is just updating it.Output
Before
We can see the error message:
Is the new one updated in the upstream dependecy
After
pack
is pulling the image using an empty platform again once the error message match the condition to retry.Note
This solution is not the best, but it will unblock pack users for now
Documentation
Related
Resolves #2315