Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/kit/src/libvirt/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ pub fn run(global_opts: &crate::libvirt::LibvirtOptions, opts: LibvirtUploadOpts
memory: opts.memory.clone(),
vcpus: opts.vcpus,
kernel_args: opts.karg.clone(),
net: Some("none".to_string()),
..Default::default()
},
..Default::default()
Expand Down
1 change: 0 additions & 1 deletion crates/kit/src/libvirt_upload_disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ pub fn run(opts: LibvirtUploadDiskOpts) -> Result<()> {
memory: opts.memory.clone(),
vcpus: opts.vcpus,
kernel_args: opts.karg.clone(),
net: Some("none".to_string()),
..Default::default()
},
..Default::default()
Expand Down
26 changes: 9 additions & 17 deletions crates/kit/src/run_ephemeral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ pub struct CommonPodmanOptions {
#[clap(long = "name", help = "Assign a name to the container")]
pub name: Option<String>,

#[clap(long = "network", help = "Configure the network for the container")]
pub network: Option<String>,

#[clap(
long = "label",
help = "Add metadata to the container in key=value form"
Expand All @@ -165,12 +168,6 @@ pub struct CommonVmOpts {
#[clap(long = "karg", help = "Additional kernel command line arguments")]
pub kernel_args: Vec<String>,

#[clap(
long,
help = "Network configuration (none, user, bridge=name) [default: none]"
)]
pub net: Option<String>,

#[clap(long, help = "Enable console output to terminal for debugging")]
pub console: bool,

Expand Down Expand Up @@ -211,11 +208,6 @@ impl CommonVmOpts {
pub fn vcpus(&self) -> u32 {
self.vcpus.unwrap_or_else(default_vcpus)
}

/// Get network config (default: "none")
pub fn net_string(&self) -> String {
self.net.clone().unwrap_or_else(|| "none".to_string())
}
}

/// Ephemeral VM options: container-style flags, host bind mounts, systemd injection.
Expand Down Expand Up @@ -380,19 +372,19 @@ fn prepare_run_command_with_temp(
for label in opts.podman.label.iter() {
cmd.arg(format!("--label={label}"));
}
cmd.arg(format!("--net={}", opts.common.net_string().as_str()));

// Add container name if specified
// Propagate all podman arguments
if let Some(ref name) = opts.podman.name {
cmd.args(["--name", name]);
}

// Add --rm flag based on user input (default: true)
// Note that (unlike the libvirt flow) we rely on the default bridge network to avoid
// port conflicts
if let Some(network) = opts.podman.network.as_deref() {
cmd.args(["--network", network]);
}
if opts.podman.rm {
cmd.arg("--rm");
}

// Add -t, -i, -d flags based on user input (mirror podman behavior)
if opts.podman.tty {
cmd.arg("-t");
}
Comment thread
cgwalters marked this conversation as resolved.
Expand Down
8 changes: 4 additions & 4 deletions docs/src/man/bcvk-ephemeral-run-ssh.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ Run ephemeral VM and SSH into it

Additional kernel command line arguments

**--net**=*NET*

Network configuration (none, user, bridge=name) [default: none]

**--console**

Enable console output to terminal for debugging
Expand Down Expand Up @@ -81,6 +77,10 @@ Run ephemeral VM and SSH into it

Assign a name to the container

**--network**=*NETWORK*

Configure the network for the container

**--label**=*LABEL*

Add metadata to the container in key=value form
Expand Down
8 changes: 4 additions & 4 deletions docs/src/man/bcvk-ephemeral-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ This design allows bcvk to provide VM-like isolation and boot behavior while lev

Additional kernel command line arguments

**--net**=*NET*

Network configuration (none, user, bridge=name) [default: none]

**--console**

Enable console output to terminal for debugging
Expand Down Expand Up @@ -107,6 +103,10 @@ This design allows bcvk to provide VM-like isolation and boot behavior while lev

Assign a name to the container

**--network**=*NETWORK*

Configure the network for the container

**--label**=*LABEL*

Add metadata to the container in key=value form
Expand Down
4 changes: 0 additions & 4 deletions docs/src/man/bcvk-to-disk.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ The installation process:

Additional kernel command line arguments

**--net**=*NET*

Network configuration (none, user, bridge=name) [default: none]

**--console**

Enable console output to terminal for debugging
Expand Down