-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Always add parent directories of files to snapshots. #1166
Always add parent directories of files to snapshots. #1166
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
9d4607f
to
5c6f63d
Compare
During a snapshot, when a file changed and not its parent directories, the parent directories weren't added to the layer. This is inconsistent with Docker's behavior which always add parent directories to the layer. In some edge-cases, it could lead to problems with docker considering that parent directories where owned by root in forthcoming layers although they shouldn't (see GoogleContainerTools#1163). Also, Docker seems to be POSIX compliant regarding the name of directories in the archive, which always have a slash appended. This commit also fixes this. Fixes GoogleContainerTools#1163
5c6f63d
to
e5585fd
Compare
This refactoring reversed the order of the "ParentDirectories" function: GoogleContainerTools@ffc372a#diff-d36eb675aa49a7b471e3a2be77005b18R465 As a side-effect, parent directories weren't added in lexicographical order, which broke some tests. We now ensure in unit test that the order of the ParentDirectories function is stable.
Had to fix a merge conflict and reverse the order of |
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.
Sorry for the delay @gilbsgilbs
LGTM!
I will do some more detailed testing with cache
turned on and get this in by EOD tomorrow
Fixes #1163
Description
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
note: I just updated existing tests which I think is enough given how they all started to fail. I you don't think so, please tell me and I'll write a proper unit test.
See the contribution guide for more details.
Reviewer Notes