Repository navigation
fix: clean up partial pull output on failure - #2194
Conversation
Signed-off-by: TanvirTian <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2194 +/- ##
==========================================
+ Coverage 87.81% 87.83% +0.02%
==========================================
Files 139 139
Lines 5689 5756 +67
==========================================
+ Hits 4996 5056 +60
- Misses 413 417 +4
- Partials 280 283 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: TanvirTian <[email protected]>
TerryHowe
left a comment
There was a problem hiding this comment.
Suggestions below are applied and verified on top of eca21fb — go build ./..., gofmt, and go test -race ./cmd/oras/... all clean.
The one behavioural point not covered by a suggestion: cleanup currently fires on any doPull error, so Ctrl-C or a dropped connection mid-pull discards everything downloaded so far. Worth deciding whether to gate it on the duplicate-name case rather than every error path.
Signed-off-by: TanvirTian <[email protected]>
|
I tried the errdef.ErrDuplicateName suggestion as it is, but it isn't available in the oras-go/v2.6.2 version currently used by this branch. I kept the equivalent file.ErrDuplicateName check instead, and the test passes with the current dependency version. |
Signed-off-by: TanvirTian <[email protected]>
Signed-off-by: TanvirTian <[email protected]>
|
Thanks @TerryHowe, Fixed both of these |
|
Thanks! |
What this PR does / why we need it:
When oras pull downloads multiple platform manifests that contain files with the same name, the pull can fail with duplicate name after one of the files has already been written to the output directory.
This change tracks files created during the pull and removes them when the pull fails, preventing partial output from being left behind.
Existing files are not removed during cleanup, preserving the normal overwrite behavior of oras pull.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #2193
Please check the following list: