Struct k8s_openapi_ext::corev1::EnvVar
source · pub struct EnvVar {
pub name: String,
pub value: Option<String>,
pub value_from: Option<EnvVarSource>,
}
Expand description
EnvVar represents an environment variable present in a Container.
Fields§
§name: String
Name of the environment variable. Must be a C_IDENTIFIER.
value: Option<String>
Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. “$$(VAR_NAME)” will produce the string literal “$(VAR_NAME)”. Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to “”.
value_from: Option<EnvVarSource>
Source for the environment variable’s value. Cannot be used if value is not empty.
Trait Implementations§
source§impl DeepMerge for EnvVar
impl DeepMerge for EnvVar
source§fn merge_from(&mut self, other: EnvVar)
fn merge_from(&mut self, other: EnvVar)
Merge
other
into self
.source§impl<'de> Deserialize<'de> for EnvVar
impl<'de> Deserialize<'de> for EnvVar
source§fn deserialize<D>(
deserializer: D
) -> Result<EnvVar, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<EnvVar, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl EnvVarExt for EnvVar
impl EnvVarExt for EnvVar
source§fn value(name: impl ToString, value: impl ToString) -> Self
fn value(name: impl ToString, value: impl ToString) -> Self
Set an env var
name
with a given value
source§fn metadata_name(name: impl ToString) -> Self
fn metadata_name(name: impl ToString) -> Self
Set an env var
name
that points to a pod’s namefn metadata_namespace(name: impl ToString) -> Self
fn metadata_uid(name: impl ToString) -> Self
source§fn spec_nodename(name: impl ToString) -> Self
fn spec_nodename(name: impl ToString) -> Self
Set an env var
name
that points to the node which this pod was requested to scheduled onsource§fn spec_service_account_name(name: impl ToString) -> Self
fn spec_service_account_name(name: impl ToString) -> Self
Set an env var
name
that points to the requested ServiceAccountName for this podfn status_host_ip(name: impl ToString) -> Self
fn status_pod_ip(name: impl ToString) -> Self
fn status_pod_ips(name: impl ToString) -> Self
source§impl PartialEq<EnvVar> for EnvVar
impl PartialEq<EnvVar> for EnvVar
source§impl Serialize for EnvVar
impl Serialize for EnvVar
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. Read more