Repository navigation
[Backport v2] fix(oci): skip digest-named directories during GC - #1588
Merged
Merged
Conversation
Backport of oras-project#1526 to v2. Store.GC skipped directories under blobs/ but not under blobs/<alg>/, so a directory named like a digest reached os.Remove, which fails on a non-empty directory and aborts GC. GC now skips those directories, and os.Remove errors include the blob path. Fixes oras-project#1579 Signed-off-by: Gaurav Jadhav <[email protected]>
jadhavgaurav
requested review from
TerryHowe,
Wwwsylvia,
sabre1041 and
shizhMSFT
as code owners
October 15, 2026 09:12
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #1588 +/- ##
=======================================
Coverage 89.21% 89.21%
=======================================
Files 64 64
Lines 4959 4961 +2
=======================================
+ Hits 4424 4426 +2
Misses 526 526
Partials 9 9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Thanks! |
This was referenced Oct 15, 2026
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #1526 to
v2. Fixes #1579.Store.GCskipped directories underblobs/but not underblobs/<alg>/. A directory whose name looks like a digest reachedos.Remove, which fails on a non-empty directory and aborts GC.Changes, matching #1526:
blobs/<alg>/loop.os.Removeerror with the blob path.os.Removeerror path.Testing: the patch from #1526 applied cleanly to
v2. With the source change reverted,TestStore_GCSkipsNonEmptyDigestNamedDirectoryandTestStore_GCSkipsEmptyDigestNamedDirectoryfail; with it,go test -race ./content/oci/...,go test ./...,go vetandgofmtpass.Partially generated with Claude Code; tests run locally.