switch: fix --apply not rebooting when already staged#2249
Open
jlebon wants to merge 2 commits into
Open
Conversation
When 'bootc switch --apply' is called targeting an image that is already staged, the spec comparison short-circuits with 'Image specification is unchanged' and returns early without rebooting. This is the same class of bug that was fixed for 'bootc upgrade --apply' in commit 0067a47. Fix both the ostree and composefs switch paths. Full AI use (reproduced bug, patched bootc, verified bugfix). I verified the verification and the patch. Signed-off-by: Jonathan Lebon <jonathan@jlebon.com>
The tmt README instructions to `tmt run` directly just won't work without the bcvk wrappers. My agent got tripped up on this. That README overall looks pretty stock. Just keep it short and redirect to CONTRIBUTING.md. While we're there, also mention tmt and libvirt, which would've helped my agent. Very mild AI assistance. Signed-off-by: Jonathan Lebon <jonathan@jlebon.com>
jlebon
commented
Jun 12, 2026
| # Now, switch into the new image. First stage it, then run switch --apply for | ||
| # the same target. This exercises the case where --apply must still reboot for | ||
| # staged deployments. | ||
| print $"Staging ($imgsrc)" |
Contributor
Author
There was a problem hiding this comment.
We're technically losing coverage here on doing a one-shot switch --apply which both had to stage and reboot together.
It didn't feel worth adding another reboot to test this since it's trivial (while the early return reboot into staged here is a more subtle gotcha), but happy to do so if folks prefer.
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.
When
bootc switch --applyis called targeting an image that is alreadystaged, the spec comparison short-circuits with 'Image specification is
unchanged' and returns early without rebooting. This is the same class
of bug that was fixed for
bootc upgrade --applyin commit 0067a47.Fix both the ostree and composefs switch paths.
Full AI use (reproduced bug, patched bootc, verified bugfix). I verified
the verification and the patch.