diff --git a/pkg/overlay/pack.go b/pkg/overlay/pack.go index 38109cc0..3a6cc7d7 100644 --- a/pkg/overlay/pack.go +++ b/pkg/overlay/pack.go @@ -725,7 +725,9 @@ func unpackOne(l ispec.Descriptor, ociDir string, extractDir string) error { return err } - err = layer.UnpackLayer(extractDir, uncompressed, nil) + // always unpack with Overlay whiteout mode to prevent ignoring whiteouts in tar layers + // see test/publish.bats: "building from published images with whiteouts" for more details + err = layer.UnpackLayer(extractDir, uncompressed, &layer.UnpackOptions{WhiteoutMode: layer.OverlayFSWhiteout}) if err != nil { if rmErr := os.RemoveAll(extractDir); rmErr != nil { log.Errorf("Failed to remove dir '%s' after failed extraction: %v", extractDir, rmErr) diff --git a/test/empty-layers.bats b/test/empty-layers.bats index 5e839af9..98265ca0 100644 --- a/test/empty-layers.bats +++ b/test/empty-layers.bats @@ -77,6 +77,9 @@ EOF } @test "a real-world docker image with empty/filler layer" { + if [ "$PRIVILEGE_LEVEL" != "priv" ]; then + skip "requires privileges" + fi cat > stacker.yaml < stacker.yaml < stacker.yaml <