Don't write whiteout files to directories that were replaced with files or links (#2590)

If a non-empty directory gets replaced with something other than a
directory (e.g. file or symlink), the files in that directory also get
deleted. However, there should not be any whiteout files for them in the
layer. If there were, the resulting tar file would not be extractable.

Fixes #2308
This commit is contained in:
Andreas Fleig
2023-06-22 10:45:47 -07:00
committed by GitHub
parent 0743c19176
commit 0d925dd651
5 changed files with 137 additions and 0 deletions
@@ -0,0 +1,5 @@
# Not prefixed Dockerfile_test to exclude it from TestRun()
FROM busybox
RUN mkdir /a /b /c && echo a > /a/d
RUN rm -r /a && echo "foo" > /a