-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathenv.rs
More file actions
20 lines (19 loc) · 584 Bytes
/
env.rs
File metadata and controls
20 lines (19 loc) · 584 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use k8s_openapi::api::core::v1::{EnvVar, EnvVarSource, SecretKeySelector};
pub fn env_var_from_secret(
env_var_name: impl Into<String>,
secret_name: impl Into<String>,
secret_key: impl Into<String>,
) -> EnvVar {
EnvVar {
name: env_var_name.into(),
value_from: Some(EnvVarSource {
secret_key_ref: Some(SecretKeySelector {
name: secret_name.into(),
key: secret_key.into(),
..Default::default()
}),
..Default::default()
}),
..Default::default()
}
}