Struct podman_api::opts::PodCreateOptsBuilder
source · [−]pub struct PodCreateOptsBuilder { /* private fields */ }
Expand description
A builder struct for PodCreateOpts.
Implementations
sourceimpl PodCreateOptsBuilder
impl PodCreateOptsBuilder
sourcepub fn build(self) -> PodCreateOpts
pub fn build(self) -> PodCreateOpts
Finish building PodCreateOpts.
sourceimpl PodCreateOptsBuilder
impl PodCreateOptsBuilder
sourcepub fn cgroup_parent(self, cgroup_parent: impl AsRef<str> + Serialize) -> Self
pub fn cgroup_parent(self, cgroup_parent: impl AsRef<str> + Serialize) -> Self
The parent for the CGroup that the pod will create. This pod cgroup will, in turn, be the default cgroup parent for all containers in the pod.
sourcepub fn cni_networks<I, S>(self, cni_networks: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn cni_networks<I, S>(self, cni_networks: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
List of CNI networks to join the container to. If this list is empty, the default CNI network will be joined instead. If at least one entry is present, we will not join the default network (unless it is part of this list). Only available if NetNS is set to bridge. Optional. Deprecated: as of podman 4.0 use “Networks” instead.
sourcepub fn cpu_period(self, cpu_period: u64) -> Self
pub fn cpu_period(self, cpu_period: u64) -> Self
CPU period of the cpuset, determined by –cpus
sourcepub fn dns_option<I, S>(self, dns_option: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn dns_option<I, S>(self, dns_option: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Set of DNS options that will be used in the infra container’s resolv.conf, which
will, by default, be shared with all containers in the pod. Conflicts with
no_infra
== true.
sourcepub fn dns_search<I, S>(self, dns_search: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn dns_search<I, S>(self, dns_search: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Set of DNS search domains that will be used in the infra container’s resolv.conf,
which will, by default, be shared with all containers in the pod. If not provided, DNS
search domains from the host’s resolv.conf will be used. Conflicts with
no_infra
== true.
sourcepub fn add_hosts<I, S>(self, add_hosts: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn add_hosts<I, S>(self, add_hosts: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Set of hosts that will be added to the infra container’s etc/hosts that will, by
default, be shared with all containers in the pod. Conflicts with
no_infra
== true and
no_manage_hosts
.
sourcepub fn hostname(self, hostname: impl AsRef<str> + Serialize) -> Self
pub fn hostname(self, hostname: impl AsRef<str> + Serialize) -> Self
The pod’s hostname. If not set, the name of the pod will be used (if a name was not provided here, the name auto-generated for the pod will be used). This will be used by the infra container and all containers in the pod as long as the UTS namespace is shared.
sourcepub fn infra_command<I, S>(self, infra_command: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn infra_command<I, S>(self, infra_command: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Sets the command that will be used to start the infra container. If not set, the
default set in the Libpod configuration file will be used. Conflicts with
no_infra
== true.
sourcepub fn infra_common_pid_file(
self,
infra_common_pid_file: impl AsRef<str> + Serialize
) -> Self
pub fn infra_common_pid_file(
self,
infra_common_pid_file: impl AsRef<str> + Serialize
) -> Self
Custom path to store the infra container’s conmon PID.
sourcepub fn infra_image(self, infra_image: impl AsRef<str> + Serialize) -> Self
pub fn infra_image(self, infra_image: impl AsRef<str> + Serialize) -> Self
The image that will be used for the infra container. If not set, the default set
in the Libpod configuration file will be used. Conflicts with
no_infra
== true.
sourcepub fn infra_name(self, infra_name: impl AsRef<str> + Serialize) -> Self
pub fn infra_name(self, infra_name: impl AsRef<str> + Serialize) -> Self
The name that will be used for the infra container. If not set, the default set in the
Libpod configuration file will be used. Conflicts with
no_infra
== true.
sourcepub fn labels<I, K, V>(self, labels: I) -> Self where
I: IntoIterator<Item = (K, V)>,
K: AsRef<str> + Serialize + Eq + Hash,
V: AsRef<str> + Serialize,
pub fn labels<I, K, V>(self, labels: I) -> Self where
I: IntoIterator<Item = (K, V)>,
K: AsRef<str> + Serialize + Eq + Hash,
V: AsRef<str> + Serialize,
Key-value pairs that are used to add metadata to a pod.
sourcepub fn name(self, name: impl AsRef<str> + Serialize) -> Self
pub fn name(self, name: impl AsRef<str> + Serialize) -> Self
The name of the pod. If not provided, a name will be generated when the pod is created.
pub fn netns(self, netns: Namespace) -> Self
sourcepub fn network_options<I, K, V>(self, network_options: I) -> Self where
I: IntoIterator<Item = (K, V)>,
K: AsRef<str> + Serialize + Eq + Hash,
V: AsRef<str> + Serialize,
pub fn network_options<I, K, V>(self, network_options: I) -> Self where
I: IntoIterator<Item = (K, V)>,
K: AsRef<str> + Serialize + Eq + Hash,
V: AsRef<str> + Serialize,
Additional options for each network.
sourcepub fn no_infra(self, no_infra: bool) -> Self
pub fn no_infra(self, no_infra: bool) -> Self
tells the pod not to create an infra container. If this is done, many networking-related options will become unavailable. Conflicts with any network or infra related settings.
sourcepub fn no_manage_hosts(self, no_manage_hosts: bool) -> Self
pub fn no_manage_hosts(self, no_manage_hosts: bool) -> Self
Indicates that /etc/hosts should not be managed by the pod. Instead, each container
will create a separate /etc/hosts as they would if not in a pod. Conflicts with
add_hosts
.
sourcepub fn no_manage_resolv_conf(self, no_manage_resolv_conf: bool) -> Self
pub fn no_manage_resolv_conf(self, no_manage_resolv_conf: bool) -> Self
Indicates that /etc/resolv.conf should not be managed by the pod. Instead, each
container will create and manage a separate resolv.conf as if they had not joined a
pod. Conflicts with dns_server
,
dns_search
,
dns_option
,
no_infra
.
pub fn pidns(self, pidns: Namespace) -> Self
sourcepub fn pod_create_command<I, S>(self, pod_create_command: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn pod_create_command<I, S>(self, pod_create_command: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
The command used to create this pod. This will be shown in the output of Inspect() on the pode and may also be used by some tools that wish to recreate the pod (e.g. podman generate systemd –new).
sourcepub fn pod_devices<I, S>(self, pod_devices: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn pod_devices<I, S>(self, pod_devices: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
User specified Devices to be added to the Pod.
sourcepub fn resource_limits(self, resource_limits: LinuxResources) -> Self
pub fn resource_limits(self, resource_limits: LinuxResources) -> Self
Container runtime resource constraints.
Instructs the pod to share a set of namespaces. Shared namespaces will be joined (by
default) by every container which joins the pod. If not set and NoInfra is false, the
pod will set a default set of namespaces to share. Conflicts with
no_infra
== true.
pub fn userns(self, userns: Namespace) -> Self
sourcepub fn volumes_from<I, S>(self, volumes_from: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn volumes_from<I, S>(self, volumes_from: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Set of containers whose volumes will be added to this pod. The name or ID of the container must be provided, and may optionally be followed by a : and then one or more comma-separated options. Valid options are ‘ro’, ‘rw’, and ‘z’. Options will be used for all volumes sourced from the container.
Trait Implementations
sourceimpl Clone for PodCreateOptsBuilder
impl Clone for PodCreateOptsBuilder
sourcefn clone(&self) -> PodCreateOptsBuilder
fn clone(&self) -> PodCreateOptsBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PodCreateOptsBuilder
impl Debug for PodCreateOptsBuilder
sourceimpl Default for PodCreateOptsBuilder
impl Default for PodCreateOptsBuilder
sourcefn default() -> PodCreateOptsBuilder
fn default() -> PodCreateOptsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for PodCreateOptsBuilder
impl Send for PodCreateOptsBuilder
impl Sync for PodCreateOptsBuilder
impl Unpin for PodCreateOptsBuilder
impl UnwindSafe for PodCreateOptsBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more