-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
dockerfile: fix oci source to load image config data #3034
Conversation
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.
This makes sense, and nice catch on the gap between oci registry and oci layout sources for dockerfile frontend.
Could we update this test to cover this. It is testing loading env but not exporting it https://github.com/moby/buildkit/pull/2827/files#diff-93731187c2a292b7e92b852225675f88b41b7634dafd66cfeab50697bd806ddbR5488-R5492 |
Have modified the test to check that workdir is correctly checked - I think that should check the exporting case correctly. I'd rather not change the exporter in the second case from the local to a oci/image, since then checking files in that is slightly more fiddly, since we have to inspect layers (maybe we should have some helpers around testutil for this). |
This test still only checks the import phase(like the env case did before) and not image export. Add a separate test that directly exports the config that is read from the oci-layout. That should then fail before this fix. |
Config from the OCI source was previously not correctly parsed and returned from the contextByName function, preventing fields like the WorkingDir from correctly being propogated through. This fix ensures that the config is correctly json-parseable, and that the data is properly returned. Signed-off-by: Justin Chadwell <me@jedevc.com>
To test the behavior in the previous commit, we check that workdir inheritance works by setting it in the base image. Additionally, we add a new test to check the exported results of images that use these oci contexts. Signed-off-by: Justin Chadwell <me@jedevc.com>
4c24598
to
c16dcec
Compare
Added a new test and confirmed it fails before the fix and fails after 👍 |
Fixes #3033
Config from the OCI source was previously not correctly parsed and returned from the contextByName function, preventing fields like the WorkingDir from correctly being propogated through.
This fix ensures that the config is correctly json-parseable, and that the data is properly returned.
CC @deitch