Support Docker-style whiteouts

This is to enable importing Docker layers as ostree commits, then
checking them out in a union.

The prototype work for this is in:
https://github.com/cgwalters/dlayer-ostree

Though it will likely ultimately end up in:
https://github.com/projectatomic/atomic
This commit is contained in:
Colin Walters committed 2016-02-16 10:54:59 -05:00
1 parent c18193bd19
commit baaf7450da
4 files changed
+84 -9

No files matched your search

+36
View File
@@ -387,6 +387,42 @@ assert_file_has_content test2-checkout/baz/cow moo
assert_has_dir repo2/uncompressed-objects-cache
echo "ok disable cache checkout"
# Whiteouts
cd ${test_tmpdir}
mkdir -p overlay/baz/
touch overlay/baz/.wh.cow
touch overlay/.wh.deeper
touch overlay/anewfile
mkdir overlay/anewdir/
touch overlay/anewdir/blah
$OSTREE --repo=repo commit -b overlay -s 'overlay' --tree=dir=overlay
rm overlay -rf
for branch in test2 overlay; do
$OSTREE --repo=repo checkout --union --whiteouts ${branch} overlay-co
done
for f in .wh.deeper baz/cow baz/.wh.cow; do
assert_not_has_file overlay-co/${f}
done
assert_not_has_dir overlay-co/deeper
assert_has_file overlay-co/anewdir/blah
assert_has_file overlay-co/anewfile
echo "ok whiteouts enabled"
# Now double check whiteouts are not processed without --whiteouts
rm overlay-co -rf
for branch in test2 overlay; do
$OSTREE --repo=repo checkout --union ${branch} overlay-co
done
for f in .wh.deeper baz/cow baz/.wh.cow; do
assert_has_file overlay-co/${f}
done
assert_not_has_dir overlay-co/deeper
assert_has_file overlay-co/anewdir/blah
assert_has_file overlay-co/anewfile
echo "ok whiteouts disabled"
cd ${test_tmpdir}
rm -rf test2-checkout
mkdir -p test2-checkout