File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,14 @@ pub(crate) struct SwitchOpts {
59
59
#[ clap( long) ]
60
60
pub ( crate ) quiet : bool ,
61
61
62
+ /// Restart or reboot into the new target image.
63
+ ///
64
+ /// Currently, this option always reboots. In the future this command
65
+ /// will detect the case where no kernel changes are queued, and perform
66
+ /// a userspace-only restart.
67
+ #[ clap( long) ]
68
+ pub ( crate ) apply : bool ,
69
+
62
70
/// The transport; e.g. oci, oci-archive, containers-storage. Defaults to `registry`.
63
71
#[ clap( long, default_value = "registry" ) ]
64
72
pub ( crate ) transport : String ,
@@ -697,6 +705,10 @@ async fn switch(opts: SwitchOpts) -> Result<()> {
697
705
let stateroot = booted_deployment. osname ( ) ;
698
706
crate :: deploy:: stage ( sysroot, & stateroot, & fetched, & new_spec) . await ?;
699
707
708
+ if opts. apply {
709
+ crate :: reboot:: reboot ( ) ?;
710
+ }
711
+
700
712
Ok ( ( ) )
701
713
}
702
714
You can’t perform that action at this time.
0 commit comments