pub struct VolumeMount {
pub name: Option<String>,
pub read_only: Option<bool>,
pub recursive_read_only: Option<String>,
pub mount_path: Option<String>,
pub sub_path: Option<String>,
pub mount_propagation: Option<String>,
pub sub_path_expr: Option<String>,
}
Expand description
VolumeMount describes a mounting of a Volume within a container.
Fields§
§name: Option<String>
This must match the Name of a Volume.
read_only: Option<bool>
Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +optional
recursive_read_only: Option<String>
RecursiveReadOnly specifies whether read-only mounts should be handled recursively.
If ReadOnly is false, this field has no meaning and must be unspecified.
If ReadOnly is true, and this field is set to Disabled, the mount is not made recursively read-only. If this field is set to IfPossible, the mount is made recursively read-only, if it is supported by the container runtime. If this field is set to Enabled, the mount is made recursively read-only if it is supported by the container runtime, otherwise the pod will not be started and an error will be generated to indicate the reason.
If this field is set to IfPossible or Enabled, MountPropagation must be set to None (or be unspecified, which defaults to None).
If this field is not specified, it is treated as an equivalent of Disabled.
+featureGate=RecursiveReadOnlyMounts +optional
mount_path: Option<String>
Path within the container at which the volume should be mounted. Must not contain ‘:’.
sub_path: Option<String>
Path within the volume from which the container’s volume should be mounted. Defaults to “” (volume’s root). +optional
mount_propagation: Option<String>
mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified (which defaults to None). +optional
sub_path_expr: Option<String>
Expanded path within the volume from which the container’s volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container’s environment. Defaults to “” (volume’s root). SubPathExpr and SubPath are mutually exclusive. +optional
Implementations§
Source§impl VolumeMount
impl VolumeMount
Sourcepub fn read_only(&self) -> bool
pub fn read_only(&self) -> bool
Returns the value of read_only
, or the default value if read_only
is unset.
Sourcepub fn mount_path(&self) -> &str
pub fn mount_path(&self) -> &str
Returns the value of mount_path
, or the default value if mount_path
is unset.
Sourcepub fn sub_path(&self) -> &str
pub fn sub_path(&self) -> &str
Returns the value of sub_path
, or the default value if sub_path
is unset.
Sourcepub fn mount_propagation(&self) -> &str
pub fn mount_propagation(&self) -> &str
Returns the value of mount_propagation
, or the default value if mount_propagation
is unset.
Sourcepub fn sub_path_expr(&self) -> &str
pub fn sub_path_expr(&self) -> &str
Returns the value of sub_path_expr
, or the default value if sub_path_expr
is unset.
Sourcepub fn recursive_read_only(&self) -> &str
pub fn recursive_read_only(&self) -> &str
Returns the value of recursive_read_only
, or the default value if recursive_read_only
is unset.
Trait Implementations§
Source§impl Clone for VolumeMount
impl Clone for VolumeMount
Source§fn clone(&self) -> VolumeMount
fn clone(&self) -> VolumeMount
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for VolumeMount
impl Debug for VolumeMount
Source§impl Default for VolumeMount
impl Default for VolumeMount
Source§impl Hash for VolumeMount
impl Hash for VolumeMount
Source§impl Message for VolumeMount
impl Message for VolumeMount
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.