Skip to content

Commit

Permalink
Add environment variables to exec sync container
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Michaelis <code@mgjm.de>
  • Loading branch information
mgjm committed Jul 18, 2023
1 parent 0c86c1d commit 97d6b46
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 195 deletions.
1 change: 1 addition & 0 deletions conmon-rs/common/proto/conmon.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ interface Conmon {
terminal @3 :Bool;
metadataOld @4 :Data; # deprecated
metadata @5 :Metadata; # Standard metadata to carry.
envVars @6 :TextTextMap;
}

struct ExecSyncContainerResponse {
Expand Down
10 changes: 9 additions & 1 deletion conmon-rs/server/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,19 @@ impl conmon::Server for Server {

let command = pry!(req.get_command());
let args = pry_err!(self.generate_exec_sync_args(&id, &pidfile, &container_io, &command));
let env_vars = pry!(req.get_env_vars().and_then(capnp_util::into_map));

Promise::from_future(
async move {
match child_reaper
.create_child(&runtime, &args, false, &mut container_io, &pidfile, vec![])
.create_child(
&runtime,
&args,
false,
&mut container_io,
&pidfile,
env_vars,
)
.await
{
Ok((grandchild_pid, token)) => {
Expand Down
Loading

0 comments on commit 97d6b46

Please sign in to comment.