Repository navigation
switch: Add --target-imgref to Support a separate update image reference - #2603
HarshwardhanPatil07 wants to merge 8 commits into
Conversation
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
a63c7f4 to
b00d6b9
Compare
|
Also the first two commits need proper messages and not just |
462a54b to
7818ea5
Compare
7818ea5 to
f511178
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Active issues misparse valid transport-prefixed targets and cause offline switches from host-only containers-storage sources to fail on OSTree hosts using unified storage.
2 open issues
9 resolved since last review
Preserve unified-store mode when importing the target image Preserve origin-only no-op when target image reference is absent Disambiguate registry host-and-port references from transport syntax Defer soft-reboot restrictions until the activation target is known Preserve pending origin changes until replacement succeeds Allow auto soft reboot to leave origin changes staged Normalize legacy manifest hashes before comparing image identity Keep status and recovery usable with stale origin transactions Prevent addon mutations from bypassing pending origin activation
Review effort: Balanced
5b16978 to
1dc67ed
Compare
Allow switch to accept an update origin separate from the image fetched now. Pass the target through OSTree staging and composefs switch so later updates can follow the recorded reference. Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com> Co-authored-by: HarshwardhanPatil07 <harshpat@redhat.com>
Keep the pulled image name alongside a staged deployment when switch chooses a different update origin. This prepares the staged state to distinguish the delivery source from the recorded origin. Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com> Co-authored-by: HarshwardhanPatil07 <harshpat@redhat.com>
Require an explicit transport for the target and parse it using the existing image reference type. Normalize 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>
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 update origin 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. Copy local deliveries from host storage before importing them into the unified store. Assisted-by: AI Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
1dc67ed to
686c19e
Compare
|
rebased |
| live_container_images.insert(image_name); | ||
| } | ||
|
|
||
| // A delivery tag may have moved since a rollback deployment was pulled. |
There was a problem hiding this comment.
Hmm this looks like something that should have been split out as a separate bugfix
| /// Retain an already imported image commit under another image reference. | ||
| /// This performs no fetch and also works when the destination does not exist yet. | ||
| #[context("Setting image reference {imgref}")] | ||
| fn set_image_reference(repo: &ostree::Repo, imgref: &ImageReference, commit: &str) -> Result<()> { |
There was a problem hiding this comment.
What's the value of this wrapper function?
|
|
||
| if source_imgref != target_imgref { | ||
| config = config.section(crate::deploy::ORIGIN_BOOTC).item( | ||
| crate::deploy::ORIGIN_SOURCE_IMAGE, |
There was a problem hiding this comment.
I want to better understand why we need to track the source image. This is the most complex part of this PR.
What would break exactly if we didn't?

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