From b4b617a42b2c160b577272c1c16b330a6d45c921 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 16 Nov 2020 14:45:34 +0100 Subject: Add passing of additional env This patch adds the code to pass the additional environment to the container job. Signed-off-by: Matthias Beyer --- src/endpoint/configured.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/endpoint/configured.rs') diff --git a/src/endpoint/configured.rs b/src/endpoint/configured.rs index f9a04d5..9e9171b 100644 --- a/src/endpoint/configured.rs +++ b/src/endpoint/configured.rs @@ -176,7 +176,7 @@ impl Endpoint { .map(|_| ()) } - pub async fn run_job(&self, job: RunnableJob, logsink: UnboundedSender, staging: Arc>) -> RResult<(Vec, ContainerHash, Script), ContainerError> { + pub async fn run_job(&self, job: RunnableJob, logsink: UnboundedSender, staging: Arc>, additional_env: Vec<(String, String)>) -> RResult<(Vec, ContainerHash, Script), ContainerError> { use crate::log::buffer_stream_to_line_stream; use tokio::stream::StreamExt; use futures::FutureExt; @@ -185,6 +185,7 @@ impl Endpoint { let envs = job.environment() .into_iter() .chain(job.package_environment().into_iter()) + .chain(additional_env.into_iter()) .map(|(k, v)| format!("{}={}", k, v)) .collect::>(); trace!("Job resources: Environment variables = {:?}", envs); -- cgit v1.2.3