-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove superfluous userxattr whiteouts
overlayfs creates whiteout entries whenever a dir is created which is not ideal. Instead, we inspect all the lower layers and only if a dir exists, we emit a whiteout entry. Note that we link against the 'stacker' branch of project-stacker/umoci Signed-off-by: Ramkumar Chinchani <[email protected]>
- Loading branch information
Showing
10 changed files
with
121 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
load helpers | ||
|
||
function setup() { | ||
stacker_setup | ||
} | ||
|
||
function teardown() { | ||
cleanup | ||
} | ||
|
||
@test "test not adding extraneous whiteouts" { | ||
cat > stacker.yaml <<EOF | ||
image: | ||
from: | ||
type: docker | ||
url: docker://public.ecr.aws/ubuntu/ubuntu:latest | ||
run: | | ||
apt-get update | ||
apt-get -y install libsensors-config | ||
EOF | ||
|
||
stacker build | ||
echo "checking" | ||
for f in $(ls oci/blobs/sha256/); do | ||
file oci/blobs/sha256/$f | grep "gzip" || { | ||
echo "skipping $f" | ||
continue | ||
} | ||
bsdtar -tvf oci/blobs/sha256/$f | ||
run "bsdtar -tvf oci/blobs/sha256/$f | grep '.wh.sensors.d'" | ||
if [ "$status" -eq 0 ]; then | ||
echo "should not have a sensors.d whiteout!"; | ||
exit 1; | ||
fi | ||
done | ||
} | ||
|
||
@test "dont emit whiteout for new dir creates" { | ||
cat > stacker.yaml <<EOF | ||
# a1.tar has /a1/file | ||
bb: | ||
from: | ||
type: docker | ||
url: docker://busybox | ||
run: | | ||
mkdir /a1 | ||
touch /a1/file | ||
nodir: | ||
from: | ||
type: built | ||
tag: bb | ||
run: | | ||
rm -rf /a1 | ||
emptydir: | ||
from: | ||
type: built | ||
tag: bb | ||
run: | | ||
rm -rf /a1 | ||
mkdir /a1 | ||
fulldir: | ||
from: | ||
type: built | ||
tag: bb | ||
run: | | ||
rm -rf /a1 | ||
mkdir /a1 | ||
touch /a1/newfile | ||
EOF | ||
|
||
stacker build | ||
} |