mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-01 21:24:36 +00:00
agent: Refactor main function
Move the sandbox creation into a new function. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
bac79eeef0
commit
1b2fe4a5be
@ -195,6 +195,14 @@ fn main() -> Result<()> {
|
|||||||
// which is required to satisfy the the lifetime constraints of the auto-generated gRPC code.
|
// which is required to satisfy the the lifetime constraints of the auto-generated gRPC code.
|
||||||
let _guard = slog_scope::set_global_logger(logger.new(o!("subsystem" => "rpc")));
|
let _guard = slog_scope::set_global_logger(logger.new(o!("subsystem" => "rpc")));
|
||||||
|
|
||||||
|
start_sandbox(&logger, &config)?;
|
||||||
|
|
||||||
|
let _ = log_handle.join();
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn start_sandbox(logger: &Logger, config: &agentConfig) -> Result<()> {
|
||||||
let shells = SHELLS.clone();
|
let shells = SHELLS.clone();
|
||||||
let debug_console_vport = config.debug_console_vport as u32;
|
let debug_console_vport = config.debug_console_vport as u32;
|
||||||
|
|
||||||
@ -262,8 +270,6 @@ fn main() -> Result<()> {
|
|||||||
|
|
||||||
server.shutdown();
|
server.shutdown();
|
||||||
|
|
||||||
let _ = log_handle.join();
|
|
||||||
|
|
||||||
if config.debug_console {
|
if config.debug_console {
|
||||||
shell_handle.join().unwrap();
|
shell_handle.join().unwrap();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user