Repository navigation
switch: Add --target-imgref to Support a separate update image reference - #2603
HarshwardhanPatil07 wants to merge 10 commits into
Conversation
353d495 to
75ea0d9
Compare
75ea0d9 to
8055a2f
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues can misidentify image sources, lose or strand pending origin changes, and break addon activation, unified-store updates, or soft-reboot behavior.
9 open issues
Prevent addon mutations from bypassing pending origin activation · New Keep status and recovery usable with stale origin transactions · New Normalize legacy manifest hashes before comparing image identity · New Allow auto soft reboot to leave origin changes staged · New Preserve pending origin changes until replacement succeeds · New Defer soft-reboot restrictions until the activation target is known · New Disambiguate registry host-and-port references from transport syntax · New Preserve origin-only no-op when target image reference is absent · New Preserve unified-store mode when importing the target image · New
Review effort: Balanced
8055a2f to
a63c7f4
Compare
Offline delivery should accept the same registry names users pass to install. Normalize target references before fetching, reject incompatible options, and avoid advertising enforced verification on an unsupported composefs path. Assisted-by: AI Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
A cached import must retain the reference used by the deployment origin so cleanup does not discard its image metadata. Handle this in the importer, respecting set_no_imgref, so direct and unified pulls share the same behavior. Reuse the existing pull preparation helper. Assisted-by: AI Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
The update origin cannot identify which offline delivery was staged. Record the pull source in each deployment origin and compare both references before fetching, preserving download-only locks on repeats. Route OSTree imports through the source while retaining the target. Cover offline repeats, source replacement, activation, and provenance after reboot on both backends. Assisted-by: AI Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
An identical image may be delivered with a different future update origin. Reuse an existing staged image only when its OCI manifest matches exactly, preserve its finalization lock, and avoid rewriting origins shared with another deployment. Assisted-by: AI Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Changing the origin of the running image should not replace the OS rollback deployment. Stage a durable origin change and apply it during finalization, validating the image and previous origin before writing. Keep download-only state across reboot and integrate cancellation with deployment deletion, rollback, and replacement. Cover recovery and the activation lifecycle with unit and reboot tests. Assisted-by: AI Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Recording an origin is only useful if later updates actually use it. Extend the reboot test to check unchanged content and a newer image at the recorded registry after completing an offline delivery. Assisted-by: AI Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Explain how to obtain an image from a temporary source while retaining the normal update origin. Document repeat behavior, activation, and user-visible restrictions with local-storage and registry examples. Assisted-by: AI Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
A redirected deployment records its update origin while containers-storage keeps the delivery name. Detect the stored host image by its OCI config ID and retain that ID during cleanup, so later updates keep using unified storage without requiring another explicit opt-in. Use the existing deployment metadata for both backends without adding persistent state or changing image aliases. Assisted-by: AI Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
a63c7f4 to
b00d6b9
Compare
| pub(crate) finalization_locked: bool, | ||
| } | ||
|
|
||
| impl OriginChange { |
There was a problem hiding this comment.
Context on all the functions that return a Result would be nice
| } | ||
| } | ||
|
|
||
| pub(crate) fn cancel(sysroot: &Dir) -> Result<()> { |
There was a problem hiding this comment.
This function is poorly named. It's not clear what we're cancelling
| .booted | ||
| .as_ref() | ||
| .context("No booted deployment")?; | ||
| if booted.require_composefs()?.verity != self.deployment |
There was a problem hiding this comment.
when will this not be true? afaics, we're only ever setting OriginChange::deployment to the booted depl verity
| opts, | ||
| UkiAddonCliOpts::Add { .. } | UkiAddonCliOpts::Remove { .. } | ||
| ) { | ||
| anyhow::ensure!( |
There was a problem hiding this comment.
why not? We allow it when we have a staged deployment
| } | ||
|
|
||
| /// Parse a transport-prefixed reference, defaulting bare image names to the registry. | ||
| pub(crate) fn parse_image_reference(value: &str) -> Result<containers_image_proxy::ImageReference> { |
There was a problem hiding this comment.
Don't we already have containers_image_proxy::ImageReference::try_from?
|
Also the first two commits need proper messages and not just |

Adds --target-imgref to bootc switch for OSTree and composefs, allowing an image to be downloaded from a temporary source while keeping a different registry for future updates.
Manually verified composefs UKI switching, repeated switches, and reboot with the previous deployment available for rollback. Verified OSTree download-only staging and both references in its .origin file.
Fixes #2464