Skip to content

Commit 8a3dd72

Browse files
committed
ephemeral: Stop propagating RUST_LOG by default, add --env
For reasons I haven't debugged yet this breaks our systemd/vsock integration. Signed-off-by: Colin Walters <[email protected]>
1 parent 1206c08 commit 8a3dd72

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

crates/kit/src/run_ephemeral.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ pub struct CommonPodmanOptions {
154154
help = "Add metadata to the container in key=value form"
155155
)]
156156
pub label: Vec<String>,
157+
158+
#[clap(
159+
long = "env",
160+
short = 'e',
161+
help = "Set environment variables in the container (key=value)"
162+
)]
163+
pub env: Vec<String>,
157164
}
158165

159166
/// Common VM configuration options for hardware, networking, and features.
@@ -400,6 +407,9 @@ fn prepare_run_command_with_temp(
400407
if opts.podman.detach {
401408
cmd.arg("-d");
402409
}
410+
for env in opts.podman.env.iter() {
411+
cmd.arg(format!("--env={env}"));
412+
}
403413

404414
let vhost_dev = Utf8Path::new(qemu::VHOST_VSOCK)
405415
.try_exists()?
@@ -463,11 +473,6 @@ fn prepare_run_command_with_temp(
463473
cmd.args(["-v", &format!("{}:/run/systemd-units:ro", units_dir)]);
464474
}
465475

466-
// Propagate this by default
467-
if let Some(log) = std::env::var("RUST_LOG").ok() {
468-
cmd.arg(format!("--env=RUST_LOG={log}"));
469-
}
470-
471476
// Pass configuration as JSON via BCK_CONFIG environment variable
472477
let config = serde_json::to_string(&opts).unwrap();
473478
cmd.args(["-e", &format!("BCK_CONFIG={config}")]);

0 commit comments

Comments
 (0)