diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-11-07 10:07:51 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-11-07 14:53:15 +0100 |
commit | a7a13531c7c0c902f676d237351471cbb89a90dd (patch) | |
tree | 81bfb615cd65faaf21cba6289fd755c4a53b5f12 /src/endpoint/configured.rs | |
parent | 545383b30c9e3660ac43038102d4b94b11b31993 (diff) |
Simplify environment variable filtering
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/endpoint/configured.rs')
-rw-r--r-- | src/endpoint/configured.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/endpoint/configured.rs b/src/endpoint/configured.rs index 998e925..f000f1c 100644 --- a/src/endpoint/configured.rs +++ b/src/endpoint/configured.rs @@ -170,13 +170,11 @@ impl Endpoint { use futures::FutureExt; let (container_id, _warnings) = { - let envs: Vec<String> = job.resources() + let envs = job.resources() .iter() - .filter_map(|r| match r { - JobResource::Environment(k, v) => Some(format!("{}={}", k, v)), - JobResource::Artifact(_) => None, - }) - .collect(); + .filter_map(JobResource::env) + .map(|(k, v)| format!("{}={}", k, v)) + .collect::<Vec<_>>(); let builder_opts = shiplift::ContainerOptions::builder(job.image().as_ref()) .env(envs.iter().map(AsRef::as_ref).collect()) |