From 716f9433bea31faa72a5f1b1ed5358ff67e2d056 Mon Sep 17 00:00:00 2001 From: kalil Date: Wed, 13 Apr 2022 00:41:56 +0200 Subject: [PATCH] kaps: Add id parameter to run command Introduce a required id parameter to the cli run command. Add usage of the container state implementation. Signed-off-by: kalil --- src/cli/run.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli/run.rs b/src/cli/run.rs index 4e311f4..0f0b568 100644 --- a/src/cli/run.rs +++ b/src/cli/run.rs @@ -15,6 +15,9 @@ use container::Container; /// The `handler` method provided below will be executed. #[derive(Debug, Args)] pub struct RunCommand { + /// Name of the container instance that will be start. It must me unique on your host + name: String, + /// The bundle used by the container. #[clap(short, long)] bundle: String, @@ -23,8 +26,8 @@ pub struct RunCommand { #[async_trait] impl Handler for RunCommand { async fn handler(&self, _: &mut env_logger::Builder) -> Result<()> { - // Create a container by passing the bundle provided in arguments to it's constructor. - let container = Container::new(&self.bundle)?; + // Create a container by passing the bundle and the id provided in arguments to it's constructor. + let mut container = Container::new(&self.bundle, &self.name)?; // Run the container // At the moment, we don't have a detached mode for the container,