Struct compose_spec::service::ConfigOrSecret
source · pub struct ConfigOrSecret {
pub source: Identifier,
pub target: Option<PathBuf>,
pub uid: Option<u32>,
pub gid: Option<u32>,
pub mode: Option<u32>,
pub extensions: Extensions,
}Expand description
Long syntax config or secret configuration.
§Config
Configs allow services to adapt their behavior without the need to rebuild a
container image. Services can only access configs when explicitly granted by the
configs field.
§Secret
Secrets grant access to sensitive data defined by the top-level
secrets on a per-service basis.
Fields§
§source: Identifier§target: Option<PathBuf>Configs: The path and name of the file to be mounted in the service’s task containers.
Defaults to /<source> if not specified.
Secrets: The name of the file to be mounted in /run/secrets/ in the service’s task
containers. Defaults to source if not specified.
uid: Option<u32>The numeric UID that owns the mounted config/secret file within the service’s task containers.
Default value when not specified is the UID from the container image’s USER.
(De)serialized from/to a string.
gid: Option<u32>The numeric GID that owns the mounted config/secret file within the service’s task containers.
Default value when not specified is the GID from the container image’s USER.
(De)serialized from/to a string.
mode: Option<u32>The permissions for the file that is mounted within the service’s task containers.
Default value is world-readable permissions (mode 0o444). The writable bit must be ignored
if set. The executable bit may be set.
Note that, when deserializing with serde_yaml, octal numbers must start with 0o, e.g.
0o555, otherwise, they are interpreted as decimal numbers. Unfortunately, for
serialization, there is no way to specify that a number should be serialized in octal form.
extensions: ExtensionsExtension values, which are (de)serialized via flattening.
Trait Implementations§
source§impl AsShort for ConfigOrSecret
impl AsShort for ConfigOrSecret
§type Short = Identifier
type Short = Identifier
as_short().source§impl Clone for ConfigOrSecret
impl Clone for ConfigOrSecret
source§fn clone(&self) -> ConfigOrSecret
fn clone(&self) -> ConfigOrSecret
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ConfigOrSecret
impl Debug for ConfigOrSecret
source§impl<'de> Deserialize<'de> for ConfigOrSecret
impl<'de> Deserialize<'de> for ConfigOrSecret
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<S> From<ConfigOrSecret> for ShortOrLong<S, ConfigOrSecret>
impl<S> From<ConfigOrSecret> for ShortOrLong<S, ConfigOrSecret>
source§fn from(value: ConfigOrSecret) -> Self
fn from(value: ConfigOrSecret) -> Self
source§impl From<Identifier> for ConfigOrSecret
impl From<Identifier> for ConfigOrSecret
source§fn from(source: Identifier) -> Self
fn from(source: Identifier) -> Self
source§impl<S> From<ShortOrLong<S, ConfigOrSecret>> for ConfigOrSecretwhere
S: Into<Self>,
impl<S> From<ShortOrLong<S, ConfigOrSecret>> for ConfigOrSecretwhere
S: Into<Self>,
source§fn from(value: ShortOrLong<S, Self>) -> Self
fn from(value: ShortOrLong<S, Self>) -> Self
source§impl PartialEq for ConfigOrSecret
impl PartialEq for ConfigOrSecret
source§fn eq(&self, other: &ConfigOrSecret) -> bool
fn eq(&self, other: &ConfigOrSecret) -> bool
self and other values to be equal, and is used
by ==.source§impl Serialize for ConfigOrSecret
impl Serialize for ConfigOrSecret
impl Eq for ConfigOrSecret
impl StructuralPartialEq for ConfigOrSecret
Auto Trait Implementations§
impl Freeze for ConfigOrSecret
impl RefUnwindSafe for ConfigOrSecret
impl Send for ConfigOrSecret
impl Sync for ConfigOrSecret
impl Unpin for ConfigOrSecret
impl UnwindSafe for ConfigOrSecret
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.