Skip to content

Commit

Permalink
Move ContainerInitArgs closer to where it is used
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuaf committed Jul 30, 2021
1 parent 682c1dd commit e0e9815
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/container/builder_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,6 @@ use crate::{

use super::{Container, ContainerStatus};

struct ContainerInitArgs {
/// Flag indicating if an init or a tenant container should be created
pub init: bool,
/// Interface to operating system primitives
pub syscall: LinuxSyscall,
/// OCI complient runtime spec
pub spec: Spec,
/// Root filesystem of the container
pub rootfs: PathBuf,
/// Socket to communicate the file descriptor of the ptty
pub console_socket: Option<FileDescriptor>,
/// Options for rootless containers
pub rootless: Option<Rootless>,
/// Path to the Unix Domain Socket to communicate container start
pub notify_path: PathBuf,
/// Pipe used to communicate with the child process
pub child: child::ChildProcess,
}
pub(super) struct ContainerBuilderImpl {
/// Flag indicating if an init or a tenant container should be created
pub init: bool,
Expand Down Expand Up @@ -137,6 +119,25 @@ impl ContainerBuilderImpl {
}
}

struct ContainerInitArgs {
/// Flag indicating if an init or a tenant container should be created
pub init: bool,
/// Interface to operating system primitives
pub syscall: LinuxSyscall,
/// OCI complient runtime spec
pub spec: Spec,
/// Root filesystem of the container
pub rootfs: PathBuf,
/// Socket to communicate the file descriptor of the ptty
pub console_socket: Option<FileDescriptor>,
/// Options for rootless containers
pub rootless: Option<Rootless>,
/// Path to the Unix Domain Socket to communicate container start
pub notify_path: PathBuf,
/// Pipe used to communicate with the child process
pub child: child::ChildProcess,
}

fn container_init(args: ContainerInitArgs) -> Result<()> {
let command = &args.syscall;
let spec = &args.spec;
Expand Down

0 comments on commit e0e9815

Please sign in to comment.