Skip to content

Commit e3530d4

Browse files
committed
Update reboot-required file with staged image context
This change updates the /run/reboot-required file to include information about the staged bootc image. This will provide users with information about what bootc image will be effective after the system has been rebooted. Fixes #1574 Signed-off-by: Brendan Shephard <[email protected]>
1 parent 310f9f5 commit e3530d4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

crates/lib/src/deploy.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,9 +794,10 @@ pub(crate) async fn stage(
794794

795795
// Unconditionally create or update /run/reboot-required to signal a reboot is needed.
796796
// This is monitored by kured (Kubernetes Reboot Daemon).
797+
let reboot_message = format!("bootc: Reboot required for image: {}", &spec.image.image);
797798
let run_dir = Dir::open_ambient_dir("/run", cap_std::ambient_authority())?;
798799
run_dir
799-
.atomic_write("reboot-required", b"")
800+
.atomic_write("reboot-required", reboot_message.as_bytes())
800801
.context("Creating /run/reboot-required")?;
801802

802803
Ok(())

tmt/tests/booted/test-image-pushpull-upgrade.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ RUN echo test content > /usr/share/blah.txt
6565
let progress = open --raw $progress_json | from json -o
6666
sanity_check_switch_progress_json $progress
6767

68-
# Check that /run/reboot-required exists and is a zero-byte file
68+
# Check that /run/reboot-required exists and is not empty
6969
let rr_meta = (ls /run/reboot-required | first)
70-
assert equal $rr_meta.size 0b
70+
assert ($rr_meta.size > 0b)
7171

7272
# Also test that the mtime changes on modification
7373
let new_root_mtime = ls -Dl /ostree/bootc | get modified

0 commit comments

Comments
 (0)