Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/lib/src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,10 @@ pub(crate) async fn stage(

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

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions tmt/tests/booted/test-image-pushpull-upgrade.nu
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ RUN echo test content > /usr/share/blah.txt
let progress = open --raw $progress_json | from json -o
sanity_check_switch_progress_json $progress

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

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