Skip to content

fix(mutate): don't skip dir replacements via whiteout in export#2191

Merged
jonjohnsonjr merged 1 commit intogoogle:mainfrom
r4f4:extract-whiteout-dir-fix
Jan 14, 2026
Merged

fix(mutate): don't skip dir replacements via whiteout in export#2191
jonjohnsonjr merged 1 commit intogoogle:mainfrom
r4f4:extract-whiteout-dir-fix

Conversation

@r4f4
Copy link
Copy Markdown
Contributor

@r4f4 r4f4 commented Jan 14, 2026

Consider a container with the following layers:

  layer1: a/foo b/bar
  layer2: .wh.a
  layer3: a/baz

When exporting those layers to a flattened filesystem, we cannot skip processing a/ because it's been visited before when a/ is a whiteout directive. Otherwise the filesystem will end up with a/foo a/baz b/bar when we expect only a/baz b/bar.

Consider a container with the following layers:
  layer1: a/foo b/bar
  layer2: .wh.a
  layer3: a/baz

When exporting those layers to a flattened filesystem, we cannot skip
processing `a/` because it's been visited before when `a/` is a whiteout
directive. Otherwise the filesystem will end up with `a/foo a/baz b/bar`
when we expect only `a/baz b/bar`.

Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
@google-cla
Copy link
Copy Markdown

google-cla bot commented Jan 14, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@sherine-k
Copy link
Copy Markdown

sherine-k commented Jan 14, 2026

This PR fixes #2029.
Can you please re-open this issue. We can still reproduce it with crane 0.20.7

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.07%. Comparing base (8b3c303) to head (798482d).
⚠️ Report is 55 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (8b3c303) and HEAD (798482d). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (8b3c303) HEAD (798482d)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2191       +/-   ##
===========================================
- Coverage   71.67%   53.07%   -18.61%     
===========================================
  Files         123      164       +41     
  Lines        9935    10940     +1005     
===========================================
- Hits         7121     5806     -1315     
- Misses       2115     4428     +2313     
- Partials      699      706        +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonjohnsonjr jonjohnsonjr merged commit 795787c into google:main Jan 14, 2026
17 checks passed
r4f4 added a commit to r4f4/oc-mirror that referenced this pull request Jan 16, 2026
Update the dependency so we get the fix for replaced directories in oci
layers google/go-containerregistry#2191
r4f4 added a commit to r4f4/oc-mirror that referenced this pull request Jan 22, 2026
Update the dependency so we get the fix for replaced directories in oci
layers google/go-containerregistry#2191
r4f4 added a commit to r4f4/oc-mirror that referenced this pull request Jan 23, 2026
Update the dependency so we get the fix for replaced directories in oci
layers google/go-containerregistry#2191
r4f4 added a commit to r4f4/oc-mirror that referenced this pull request Jan 27, 2026
Update the dependency so we get the fix for replaced directories in oci
layers google/go-containerregistry#2191
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/oc-mirror that referenced this pull request Jan 28, 2026
Update the dependency so we get the fix for replaced directories in oci
layers google/go-containerregistry#2191
r4f4 added a commit to r4f4/oc-mirror that referenced this pull request Feb 3, 2026
Update the dependency so we get the fix for replaced directories in oci
layers google/go-containerregistry#2191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants