use std::os::unix::prelude::RawFd;
use std::path::PathBuf;
use std::rc::Rc;
use libcgroups::common::CgroupConfig;
use nix::unistd::Pid;
use oci_spec::runtime::Spec;
use crate::container::Container;
use crate::notify_socket::NotifyListener;
use crate::syscall::syscall::SyscallType;
use crate::user_ns::UserNamespaceConfig;
use crate::workload::Executor;
#[derive(Debug, Copy, Clone)]
pub enum ContainerType {
InitContainer,
TenantContainer {
exec_notify_fd: RawFd,
landlord_init_pid: Option<Pid>,
},
}
#[derive(Clone)]
pub struct ContainerArgs {
pub container_type: ContainerType,
pub syscall: SyscallType,
pub spec: Rc<Spec>,
pub rootfs: PathBuf,
pub console_socket: Option<RawFd>,
pub notify_listener: NotifyListener,
pub preserve_fds: i32,
pub container: Option<Container>,
pub user_ns_config: Option<UserNamespaceConfig>,
pub cgroup_config: CgroupConfig,
pub detached: bool,
pub executor: Box<dyn Executor>,
pub no_pivot: bool,
pub stdin: Option<RawFd>,
pub stdout: Option<RawFd>,
pub stderr: Option<RawFd>,
pub as_sibling: bool,
pub pid_file: Option<PathBuf>,
}