Repository navigation
Conversation
…p proposal Signed-off-by: Terry Howe <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2358 +/- ##
==========================================
+ Coverage 90.68% 90.70% +0.01%
==========================================
Files 156 157 +1
Lines 6625 7111 +486
==========================================
+ Hits 6008 6450 +442
- Misses 362 384 +22
- Partials 255 277 +22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 24, 2026
Refs oras-project#2364 Signed-off-by: Terry Howe <[email protected]>
8 tasks
4 tasks done
…rgument Keep the restore target to <target-registry>[/<namespace>] only, and reject a tag or digest in it, so a selector is never read as a destination. Selective restore (Mode 2) uses repeatable --include patterns matched against the source references in the backup. Signed-off-by: Terry Howe <[email protected]>
9 tasks
A backup can read from several registries and a restore with a rules file can push to several, so a single --plain-http, --ca-file, credential or header flag cannot say which registry it applies to. Take all registry settings from per-registry configuration instead, list the replacement for each removed flag, and record the prerequisites: per-registry plain HTTP and reading containers configuration without the experimental variable. Signed-off-by: Terry Howe <[email protected]>
…ompatibility Signed-off-by: Terry Howe <[email protected]>
Signed-off-by: Terry Howe <[email protected]>
8 tasks
TerryHowe
marked this pull request as ready for review
November 27, 2026 15:06
TerryHowe
requested review from
Wwwsylvia,
sabre1041,
sajayantony and
shizhMSFT
as code owners
November 27, 2026 15:06
This was referenced Nov 27, 2026
This was referenced Nov 29, 2026
3 of 4 tasks
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.
What this PR does / why we need it:
Updates the multi-repository backup/restore proposal (#1917) in four ways.
1. Always record the full reference.
org.opencontainers.image.ref.namealways holds<registry>/<repository>:<tag>. The tag-only default and the--full-referenceflag are removed, so there is one backup format.oras backupandoras restoreare experimental, so the format changes without an opt-in flag. Restore still reads tag-only backups from earlier versions, but earlier clients cannot restore new backups. The Backward Compatibility section spells this out.2. Allow backups from multiple registries. The same-registry restriction came from an oras-go limitation at the time, and it forced the air-gap scenario in #1893 into one archive per registry. The proposal now allows mixed-registry backups and restoring them to one registry, with these defaults:
backupandrestoredrop the credential, TLS, header and--distribution-specflags, even when only one registry is involved. Credentials come from the credential store (oras login,--registry-config). TLS, plain HTTP and referrers settings come fromregistries.conf/certs.d.--registry-configand--resolvestay. Prerequisites (per-registry plain HTTP, and reading containers configuration without the experimental variable) and the implementation are tracked in [Draft] feat(backup,restore)!: remove global registry flags #2380.<registry>[/<namespace>], which the existing use cases already relied on.docker.io/library/nginxandmirror.gcr.io/library/nginx), restore fails before pushing anything. Dry-run reports collisions too.--preserve-source-registry(new restore flag): keeps the source host as the first path component, e.g.airgap/docker.io/library/nginx. The host is lowercased and a port:becomes_(registry.lan:5000→registry.lan_5000) so the result is a valid repository name; IPv6 literal hosts and names over 255 characters fail before pushing. Cannot be combined with--rules.3. Always keep the repository path on restore. A single positional restore argument is always
<registry>[/<namespace>], however many repositories the backup holds. A backup containing onlydocker.io/library/redis:7.2-alpinerestored toharbor.local/myprojectgoes toharbor.local/myproject/library/redis:7.2-alpine, the same place it would go in a multi-repository backup. This changes existing restore command lines:oras restore --input backup.tar target.com/team/repoused to push totarget.com/team/repoand now pushes totarget.com/team/repo/team/repo. Tag-only backups from earlier versions record no repository path, so for them the argument is still the target repository. Renaming on restore is left to rules files (Mode 3) for now.4. Select what to restore with
--include, not the target argument. Mode 2 no longer takes a list of positional target repositories. Artifacts are selected with repeatable--include <pattern>flags that match the source reference ([<registry>/]<repository>[:<tag>],*wildcard), and the single positional argument is always the destination. A tag or digest on the target (e.g.target.com/repo:v1,v2) is rejected instead of being reinterpreted, so existing scripts fail visibly; use--include '*:v1' --include '*:v2'. Patterns that match nothing fail before anything is pushed, and--includecannot be combined with--rules. Patterns are split into repository and tag parts at the last:after the last/(so registry ports work),*stays within its part, and Docker Hub short names are not expanded. On tag-only backups from earlier versions, only*/*:<tag>patterns match.Other changes:
--oci-layout <path>:<tag>splits on the last:and cannot address a full reference; the docs now point to--oci-layout-pathinstead.library/, matching Mode 2's path-preserving behavior.Part 1 is already implemented: #1904 writes the full reference to
ref.name, with no flag.Which issue(s) this PR fixes:
Related to #1893
Please check the following list: