Skip to content

switch: fix --apply not rebooting when already staged#2249

Open
jlebon wants to merge 2 commits into
bootc-dev:mainfrom
jlebon:pr/fix-apply-staged
Open

switch: fix --apply not rebooting when already staged#2249
jlebon wants to merge 2 commits into
bootc-dev:mainfrom
jlebon:pr/fix-apply-staged

Conversation

@jlebon

@jlebon jlebon commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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.

jlebon added 2 commits June 12, 2026 12:03
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>
@github-actions github-actions Bot added the area/documentation Updates to the documentation label Jun 12, 2026
@bootc-bot bootc-bot Bot requested a review from jeckersb June 12, 2026 17:02
# 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)"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Updates to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant