Fix opq whiteouts problems for files with dot prefix #17819
Merged
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.
Fixes #17766
Previously, opaque directory whiteouts on non-native
graphdrivers depended on the file order, meaning
files added with the same layer before the whiteout
file
.wh..wh..opq
were also removed.If that file happened to have subdirs, then calling
chtimes on those dirs after unpack would fail the pull.
Signed-off-by: Tonis Tiigi tonistiigi@gmail.com
The problem that we don't know if directory is opaque until we reach a subfile is quite problematic to solve safely and efficiently unless we think its acceptable to scan a file twice. Hopefully in the future we can define a more limited specification for the tarball (this has come up with other issues as well) with forced ordering, required parent folders, forbidden duplicate files etc., that would make it a bit more easier.
The current method may not work if files added with the opaque whiteout don't have records for their parent folders, but docker doesn't generate such tarballs.