Skip to content

Commit

Permalink
Remove the is_exec_builder as it is redundant, replace with !init
Browse files Browse the repository at this point in the history
  • Loading branch information
YJDoc2 authored and utam0k committed Sep 1, 2022
1 parent f1bffee commit 76b85f6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
8 changes: 2 additions & 6 deletions crates/libcontainer/src/container/builder_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ pub(super) struct ContainerBuilderImpl<'a> {
pub container: Option<Container>,
/// File descriptos preserved/passed to the container init process.
pub preserve_fds: i32,
/// Denotes if the builder is for the exec call or not
pub is_exec_builder: bool,
}

impl<'a> ContainerBuilderImpl<'a> {
Expand Down Expand Up @@ -124,10 +122,8 @@ impl<'a> ContainerBuilderImpl<'a> {
cgroup_manager: cmanager,
};

let (intermediate, init_pid) = process::container_main_process::container_main_process(
&container_args,
self.is_exec_builder,
)?;
let (intermediate, init_pid) =
process::container_main_process::container_main_process(&container_args, !self.init)?;

// if file to write the pid to is specified, write pid of the child
if let Some(pid_file) = &self.pid_file {
Expand Down
1 change: 0 additions & 1 deletion crates/libcontainer/src/container/init_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ impl<'a> InitContainerBuilder<'a> {
notify_path,
container: Some(container.clone()),
preserve_fds: self.base.preserve_fds,
is_exec_builder: false,
};

builder_impl.create()?;
Expand Down
1 change: 0 additions & 1 deletion crates/libcontainer/src/container/tenant_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ impl<'a> TenantContainerBuilder<'a> {
notify_path: notify_path.clone(),
container: None,
preserve_fds: self.base.preserve_fds,
is_exec_builder: true,
};

let pid = builder_impl.create()?;
Expand Down

0 comments on commit 76b85f6

Please sign in to comment.