Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
Signed-off-by: yihuaf <yihuaf@unkies.org>
  • Loading branch information
yihuaf committed Jul 4, 2023
1 parent 1ba0a11 commit b220267
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/libcontainer/src/container/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ impl ContainerBuilder {
/// )
/// .with_executor(get_executor());
/// ```
pub fn with_executor(mut self, executor: Executor) -> Result<Self, LibcontainerError> {
pub fn with_executor(mut self, executor: Executor) -> Self {
self.executor = executor;
Ok(self)
self
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/libcontainer/src/container/builder_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion crates/libcontainer/src/process/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct ContainerArgs {
/// Socket to communicate the file descriptor of the ptty
pub console_socket: Option<RawFd>,
/// 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
Expand Down
2 changes: 1 addition & 1 deletion crates/libcontainer/src/process/container_init_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion crates/youki/src/commands/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?
Expand Down
2 changes: 1 addition & 1 deletion crates/youki/src/commands/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::workload::executor::default_executor;

pub fn exec(args: Exec, root_path: PathBuf) -> Result<i32> {
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())?
Expand Down
2 changes: 1 addition & 1 deletion crates/youki/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::workload::executor::default_executor;

pub fn run(args: Run, root_path: PathBuf, systemd_cgroup: bool) -> Result<i32> {
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)?
Expand Down

0 comments on commit b220267

Please # to comment.