Repository navigation
feat(restore)!: restore multi-repository backups to <registry>[/<namespace>] - #2376
Conversation
|
Thanks for picking this up! Mode 1 is in good shape: the target mapping, the collision check before pushing (including Please drop tag selection from the target argument. With
Keeping tag-only backup support as you have it is right; that's what #2364 asks for. A few smaller things:
|
|
Thanks for the thorough review! Updated:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2376 +/- ##
==========================================
- Coverage 90.73% 90.70% -0.03%
==========================================
Files 157 157
Lines 7069 7111 +42
==========================================
+ Hits 6414 6450 +36
- Misses 381 384 +3
- Partials 274 277 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…space>] Restore each artifact in a backup to <target>/<source repository> instead of pushing every artifact into one repository. The target argument is now <registry>[/<namespace>], so repositories with the same tag no longer collide. - Add --preserve-source-registry to keep the source registry in the target repository path. - Detect two source repositories mapping to the same target repository, and invalid target repositories, before anything is pushed. - Report the source and target of each artifact, including in --dry-run. - Match specified tags in every repository of the backup. - Tag-only backups from earlier versions still restore to the given <registry>/<repository>. BREAKING CHANGE: `oras restore --input backup.tar registry.com/team/repo` now restores a backup of `src.com/team/repo:tag` to `registry.com/team/repo/team/repo:tag`. Fixes oras-project#2364 Signed-off-by: orion777-cmd <[email protected]>
- Accept only <registry>[/<namespace>] as the restore target and reject a tag or digest in it, instead of using tags to select artifacts. - Report every colliding pair of source repositories. - Explain in the flag help and the error that --preserve-source-registry does not support source registries with a port. - Rename restoreOptions.repository to target. - Add e2e cases for restoring several repositories to a registry, collisions, --preserve-source-registry, and a tag in the target. Signed-off-by: orion777-cmd <[email protected]>
Signed-off-by: orion777-cmd <[email protected]>
Signed-off-by: orion777-cmd <[email protected]>
f91c6d0 to
2ed6fa6
Compare
|
Thanks! |
What this PR does / why we need it:
Implements Mode 1 ("Direct Restore") from the proposal in #2358.
oras restorenow treats its argument as<registry>[/<namespace>]and restores each artifact to<target>/<source repository>, so a backup with several repositories can be restored, including repositories that share a tag.--preserve-source-registryto keep the source registry in the target path.--dry-runand the normal output report the source → target mapping.<target>:v1,v2) match in every repository of the backup.<registry>/<repository>.Open question: tag filtering on a bare registry target (
harbor.local:v1) is ambiguous with a port, so tags currently need a namespace (harbor.local/ns:v1). Happy to change this.Opened as a draft until #2358 is agreed.
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 #2364
Please check the following list: