-
Notifications
You must be signed in to change notification settings - Fork 53
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
bib: check that architecture is expected arch #347
bib: check that architecture is expected arch #347
Conversation
4d6bf90
to
e7f4721
Compare
9d23cd9
to
b5f5f66
Compare
a93a394
to
f4bf2ac
Compare
995d0e2
to
00fbe01
Compare
3c84943
to
c3225be
Compare
0de96ec
to
6bce9a9
Compare
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.
Love this!
Thanks so much for this @mvo5 this was much needed! |
This is useful for cross arch container buildtesting. Note that this always pass `--arch` when doing `podman build` because without that the default behavior is to pull whatever arch was pulled for this image ref last but we want "native" if nothing else is specified. Note: This just passes `platform.uname().machine` which uses the kernel architecture names. podman seems to translate those kernel arch names to go arches automatically.
When trying to build an image with an incompatible target arch bib will currently not error because the container resolver is not very strict about the architecture request. This commit fixes this by double checking that the resolved container is actually of the expected architecture. This requires osbuild/images#585
6bce9a9
to
bb82266
Compare
return nil, nil, fmt.Errorf("failed to pull container image: %w\n%s", err, output) | ||
} | ||
} | ||
|
||
// TODO: check arch compat before pulling |
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.
There is a TODO added, but not removed after the commit, I have a feeling this may have broken manifest compatibility, see: osbuild/images#635 (review)
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.
Reverting this commit and using @kingsleyzissou 's fixes on images, I am able to build the manifest correctly: AMD64 test:
ARM64 test:
|
When trying to build an image with an incompatible target arch
bib will currently not error because the container resolver is
not very strict about the architecture request.
This commit fixes this by double checking that the resolved
container is actually of the expected architecture.
This requires osbuild/images#585