mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
hypha: implement attach option on launch to connect to console
This commit is contained in:
parent
cbfac5cdf4
commit
3a04a2fe26
@ -31,6 +31,8 @@ enum Commands {
|
|||||||
config_bundle: Option<String>,
|
config_bundle: Option<String>,
|
||||||
#[arg[short, long]]
|
#[arg[short, long]]
|
||||||
env: Option<Vec<String>>,
|
env: Option<Vec<String>>,
|
||||||
|
#[arg(short, long)]
|
||||||
|
attach: bool,
|
||||||
#[arg()]
|
#[arg()]
|
||||||
image: String,
|
image: String,
|
||||||
#[arg(allow_hyphen_values = true, trailing_var_arg = true)]
|
#[arg(allow_hyphen_values = true, trailing_var_arg = true)]
|
||||||
@ -71,6 +73,7 @@ fn main() -> Result<()> {
|
|||||||
cpus,
|
cpus,
|
||||||
mem,
|
mem,
|
||||||
config_bundle,
|
config_bundle,
|
||||||
|
attach,
|
||||||
env,
|
env,
|
||||||
run,
|
run,
|
||||||
} => {
|
} => {
|
||||||
@ -87,6 +90,9 @@ fn main() -> Result<()> {
|
|||||||
if run.is_empty() { None } else { Some(run) },
|
if run.is_empty() { None } else { Some(run) },
|
||||||
)?;
|
)?;
|
||||||
println!("launched container: {}", uuid);
|
println!("launched container: {}", uuid);
|
||||||
|
if attach {
|
||||||
|
controller.console(&uuid.to_string())?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Commands::Destroy { container } => {
|
Commands::Destroy { container } => {
|
||||||
|
Loading…
Reference in New Issue
Block a user