File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 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 {
5959     #[ clap( long) ]  
6060    pub ( crate )  quiet :  bool , 
6161
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+ 
6270    /// The transport; e.g. oci, oci-archive, containers-storage.  Defaults to `registry`. 
6371     #[ clap( long,  default_value = "registry" ) ]  
6472    pub ( crate )  transport :  String , 
@@ -697,6 +705,10 @@ async fn switch(opts: SwitchOpts) -> Result<()> {
697705    let  stateroot = booted_deployment. osname ( ) ; 
698706    crate :: deploy:: stage ( sysroot,  & stateroot,  & fetched,  & new_spec) . await ?; 
699707
708+     if  opts. apply  { 
709+         crate :: reboot:: reboot ( ) ?; 
710+     } 
711+ 
700712    Ok ( ( ) ) 
701713} 
702714
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments