File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -794,7 +794,14 @@ pub(crate) async fn stage(
794
794
795
795
// Unconditionally create or update /run/reboot-required to signal a reboot is needed.
796
796
// This is monitored by kured (Kubernetes Reboot Daemon).
797
- let reboot_message = format ! ( "bootc: Reboot required for image: {}" , & spec. image. image) ;
797
+ write_reboot_required ( & image. manifest_digest . as_ref ( ) ) ?;
798
+
799
+ Ok ( ( ) )
800
+ }
801
+
802
+ /// Update the /run/reboot-required file with the image that will be active after a reboot.
803
+ fn write_reboot_required ( image : & str ) -> Result < ( ) > {
804
+ let reboot_message = format ! ( "bootc: Reboot required for image: {}" , image) ;
798
805
let run_dir = Dir :: open_ambient_dir ( "/run" , cap_std:: ambient_authority ( ) ) ?;
799
806
run_dir
800
807
. atomic_write ( "reboot-required" , reboot_message. as_bytes ( ) )
@@ -870,6 +877,8 @@ pub(crate) async fn rollback(sysroot: &Storage) -> Result<()> {
870
877
println ! ( "Next boot: rollback deployment" ) ;
871
878
}
872
879
880
+ write_reboot_required ( rollback_image. manifest_digest . as_ref ( ) ) ?;
881
+
873
882
sysroot. update_mtime ( ) ?;
874
883
875
884
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments