Repository navigation
switch: Add --target-imgref to Support a separate update image reference #2603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HarshwardhanPatil07
wants to merge
8
commits into
bootc-dev:main
Choose a base branch
from
HarshwardhanPatil07:fix/switch-target-imgref
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f73bc7c
switch: Add a target reference for future updates
Johan-Liebert1 457dc3e
composefs: Record the delivery source for redirected staging
Johan-Liebert1 c472be3
switch: Validate and normalize target image references
HarshwardhanPatil07 33ef382
ostree: Retain target references for cached image imports
HarshwardhanPatil07 a9f10e4
switch: Persist source provenance for repeated requests
HarshwardhanPatil07 b8e7f67
tests: Verify updates after redirected switches
HarshwardhanPatil07 75ce847
docs: Explain redirected switch and activation behavior
HarshwardhanPatil07 686c19e
storage: Preserve unified storage across redirected switches
HarshwardhanPatil07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -236,7 +236,8 @@ pub(crate) fn update_boot_digest_in_origin( | |
| /// | ||
| /// * `root_path` - The root filesystem path (typically `/sysroot`) | ||
| /// * `deployment_id` - Unique SHA512 hash identifier for this deployment | ||
| /// * `imgref` - Container image reference for the deployment | ||
| /// * `source_imgref` - Container image reference used to obtain this image | ||
| /// * `target_imgref` - Optional reference for subsequent updates | ||
| /// * `initialize_var` - Whether to populate the shared `/var` from the image | ||
| /// * `boot_type` - Boot artifact type (`Bls`, `Uki`, or `Aboot`) | ||
| /// * `boot_digest` - Optional boot digest for verification | ||
|
|
@@ -254,7 +255,8 @@ pub(crate) fn update_boot_digest_in_origin( | |
| pub(crate) async fn write_composefs_state( | ||
| root_path: &Utf8PathBuf, | ||
| deployment_id: &Sha512HashValue, | ||
| target_imgref: &ImageReference, | ||
| source_imgref: &ImageReference, | ||
| target_imgref: Option<&ImageReference>, | ||
| initialize_var: bool, | ||
| boot_type: BootType, | ||
| boot_digest: String, | ||
|
|
@@ -285,13 +287,22 @@ pub(crate) async fn write_composefs_state( | |
| allow_missing_fsverity, | ||
| )?; | ||
|
|
||
| let target_imgref = target_imgref.unwrap_or(source_imgref); | ||
| let imgref = target_imgref.to_image_proxy_ref()?; | ||
|
|
||
| let mut config = tini::Ini::new().section("origin").item( | ||
| ORIGIN_CONTAINER, | ||
| let mut config = tini::Ini::new() | ||
| .section("origin") | ||
| // TODO (Johan-Liebert1): The image won't always be unverified | ||
| format!("ostree-unverified-image:{imgref}"), | ||
| ); | ||
| .item( | ||
| ORIGIN_CONTAINER, | ||
| format!("ostree-unverified-image:{imgref}"), | ||
| ); | ||
|
|
||
| if source_imgref != target_imgref { | ||
| config = config.section(crate::deploy::ORIGIN_BOOTC).item( | ||
| crate::deploy::ORIGIN_SOURCE_IMAGE, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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? |
||
| source_imgref.to_string(), | ||
| ); | ||
| } | ||
|
|
||
| config = config | ||
| .section(ORIGIN_KEY_BOOT) | ||
|
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this looks like something that should have been split out as a separate bugfix