-
Notifications
You must be signed in to change notification settings - Fork 40
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
first pass at handling usrmerge #154
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4b33ff9
to
25e71de
Compare
sergiusens
reviewed
Nov 30, 2022
sergiusens
reviewed
Nov 30, 2022
719e842
to
c6d0558
Compare
This commit is a first step in gracefully handling existing layers when packing the parts' contents. Specifically, it fixes the existing breakage where priming a file in "/lib" will break a resulting Ubuntu-based rock because on the base "/lib" is a symlink to "/usr/lib", and if that link is broken everything breaks. The updates to support this are: - Enhance oci.Image.add_layer() to take the existing base into account, via a parameter that points to the extracted base (see below); - Update lifecycle code to pass the extracted base forward when packing; - Add a jammy runner to CI, because the new integrated tests need umoci which is only available on jammy. The update to add_layer() is to look for a file's parent dir in the existing base. If it *does* exist, and is a symlink to another dir, add the file as belonging to the symlink target instead. For example: - The prime dir contains "bin/file.txt"; - The base is ubuntu:22.04, which means that there "/bin/" is a symlink to "/usr/bin"; - Instead of adding the file as "bin/file.txt", add it as "usr/bin/file.txt".
39bcaad
to
38796dd
Compare
lengau
reviewed
Dec 2, 2022
Co-authored-by: Alex Lowe <lengau@gmail.com>
7569160
to
7c5d63d
Compare
cjdcordeiro
requested changes
Dec 5, 2022
cmatsuoka
reviewed
Dec 5, 2022
cjdcordeiro
approved these changes
Dec 8, 2022
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.
LGTM, thanks
cmatsuoka
approved these changes
Dec 8, 2022
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.
Looks good, thank you.
lengau
approved these changes
Dec 8, 2022
lengau
approved these changes
Dec 8, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit is a first step in gracefully handling existing layers when
packing the parts' contents. Specifically, it fixes the existing
breakage where priming a file in "/lib" will break a resulting
Ubuntu-based rock because on the base "/lib" is a symlink to "/usr/lib",
and if that link is broken everything breaks.
The updates to support this are:
via a parameter that points to the extracted base (see below);
which is only available on jammy.
The update to add_layer() is to look for a file's parent dir in the
existing base. If it does exist, and is a symlink to another dir, add
the file as belonging to the symlink target instead. For example:
to "/usr/bin";
"usr/bin/file.txt".
Note that the original idea of just adding "bin/file.txt" but not adding
the "bin/" itself seems to be flaky; it works on some configurations of
the relevant tools but not others (more investigation necessary).