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(
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) ;
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) ;
798805 let run_dir = Dir :: open_ambient_dir ( "/run" , cap_std:: ambient_authority ( ) ) ?;
799806 run_dir
800807 . atomic_write ( "reboot-required" , reboot_message. as_bytes ( ) )
@@ -870,6 +877,8 @@ pub(crate) async fn rollback(sysroot: &Storage) -> Result<()> {
870877 println ! ( "Next boot: rollback deployment" ) ;
871878 }
872879
880+ write_reboot_required ( rollback_image. manifest_digest . as_ref ( ) ) ?;
881+
873882 sysroot. update_mtime ( ) ?;
874883
875884 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments