fix: Fallback to blob upload when cross-repo mount fails#1924
fix: Fallback to blob upload when cross-repo mount fails#1924bupd wants to merge 6 commits intooras-project:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds automatic fallback to regular blob upload when cross-repository blob mount fails due to permission errors. ORAS currently fails when Harbor or other registries deny mount requests from private repositories the user doesn't have access to. This change makes the tool resilient by retrying the operation without the mount optimization when permission-related errors are detected.
Key Changes:
- Refactored copy logic into a reusable
executeCopyclosure to enable retry functionality - Added error detection and retry logic that disables mounting when authorization failures occur
- Maintained all existing copy paths (recursive, empty reference, and standard copy)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
shizhMSFT
left a comment
There was a problem hiding this comment.
Other parts of the code looks fine.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1924 +/- ##
==========================================
- Coverage 87.22% 87.20% -0.02%
==========================================
Files 143 143
Lines 5540 5549 +9
==========================================
+ Hits 4832 4839 +7
- Misses 421 423 +2
Partials 287 287 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
|
@shizhMSFT , @Wwwsylvia fixed review comments, Thanks for the review. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
What this PR does / why we need it
ORAS currently fails to push when registry(Harbor) denies a cross-repository blob mount, which happens when the destination user lacks access to the source project. In private registries this is common, making mount attempts unreliable.
This PR makes ORAS automatically fall back to a normal blob upload when the mount is denied, matching expected registry client behavior and ensuring pushes succeed even without cross-project permissions.
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 #1892
Please check the following list: