diff --git a/crates/libcontainer/src/container/builder.rs b/crates/libcontainer/src/container/builder.rs index 5667c08a08..c568146a23 100644 --- a/crates/libcontainer/src/container/builder.rs +++ b/crates/libcontainer/src/container/builder.rs @@ -252,9 +252,9 @@ impl ContainerBuilder { /// ) /// .with_executor(get_executor()); /// ``` - pub fn with_executor(mut self, executor: Executor) -> Result { + pub fn with_executor(mut self, executor: Executor) -> Self { self.executor = executor; - Ok(self) + self } } diff --git a/crates/libcontainer/src/container/builder_impl.rs b/crates/libcontainer/src/container/builder_impl.rs index d4b7dde64f..787b1cdf05 100644 --- a/crates/libcontainer/src/container/builder_impl.rs +++ b/crates/libcontainer/src/container/builder_impl.rs @@ -141,7 +141,7 @@ impl ContainerBuilderImpl { spec: self.spec.to_owned(), rootfs: self.rootfs.to_owned(), console_socket: self.console_socket, - notify_socket: notify_listener, + notify_listener, preserve_fds: self.preserve_fds, container: self.container.to_owned(), rootless: self.rootless.to_owned(), diff --git a/crates/libcontainer/src/process/args.rs b/crates/libcontainer/src/process/args.rs index 56f3b149a3..51530d2cd7 100644 --- a/crates/libcontainer/src/process/args.rs +++ b/crates/libcontainer/src/process/args.rs @@ -28,7 +28,7 @@ pub struct ContainerArgs { /// Socket to communicate the file descriptor of the ptty pub console_socket: Option, /// The Unix Domain Socket to communicate container start - pub notify_socket: NotifyListener, + pub notify_listener: NotifyListener, /// File descriptors preserved/passed to the container init process. pub preserve_fds: i32, /// Container state diff --git a/crates/libcontainer/src/process/container_init_process.rs b/crates/libcontainer/src/process/container_init_process.rs index ce01635d25..51086097cc 100644 --- a/crates/libcontainer/src/process/container_init_process.rs +++ b/crates/libcontainer/src/process/container_init_process.rs @@ -341,7 +341,7 @@ pub fn container_init_process( let hooks = spec.hooks().as_ref(); let container = args.container.as_ref(); let namespaces = Namespaces::try_from(linux.namespaces().as_ref())?; - let notify_listener = &args.notify_socket; + let notify_listener = &args.notify_listener; setsid().map_err(|err| { tracing::error!(?err, "failed to setsid to create a session"); diff --git a/crates/youki/src/commands/create.rs b/crates/youki/src/commands/create.rs index b374107462..009a7854d1 100644 --- a/crates/youki/src/commands/create.rs +++ b/crates/youki/src/commands/create.rs @@ -14,7 +14,7 @@ use crate::workload::executor::default_executor; // associated with it like any other process. pub fn create(args: Create, root_path: PathBuf, systemd_cgroup: bool) -> Result<()> { ContainerBuilder::new(args.container_id.clone(), SyscallType::default()) - .with_executor(default_executor())? + .with_executor(default_executor()) .with_pid_file(args.pid_file.as_ref())? .with_console_socket(args.console_socket.as_ref()) .with_root_path(root_path)? diff --git a/crates/youki/src/commands/exec.rs b/crates/youki/src/commands/exec.rs index 4d244e7376..859e88a762 100644 --- a/crates/youki/src/commands/exec.rs +++ b/crates/youki/src/commands/exec.rs @@ -9,7 +9,7 @@ use crate::workload::executor::default_executor; pub fn exec(args: Exec, root_path: PathBuf) -> Result { let pid = ContainerBuilder::new(args.container_id.clone(), SyscallType::default()) - .with_executor(default_executor())? + .with_executor(default_executor()) .with_root_path(root_path)? .with_console_socket(args.console_socket.as_ref()) .with_pid_file(args.pid_file.as_ref())? diff --git a/crates/youki/src/commands/run.rs b/crates/youki/src/commands/run.rs index 75c08d0ae3..5f0e33124a 100644 --- a/crates/youki/src/commands/run.rs +++ b/crates/youki/src/commands/run.rs @@ -16,7 +16,7 @@ use crate::workload::executor::default_executor; pub fn run(args: Run, root_path: PathBuf, systemd_cgroup: bool) -> Result { let mut container = ContainerBuilder::new(args.container_id.clone(), SyscallType::default()) - .with_executor(default_executor())? + .with_executor(default_executor()) .with_pid_file(args.pid_file.as_ref())? .with_console_socket(args.console_socket.as_ref()) .with_root_path(root_path)?