kratactl/cli/image/
mod.rs1use anyhow::Result;
2use clap::{Parser, Subcommand};
3use tonic::transport::Channel;
4
5use krata::events::EventStream;
6use krata::v1::control::control_service_client::ControlServiceClient;
7
8use crate::cli::image::pull::ImagePullCommand;
9
10pub mod pull;
11
12#[derive(Parser)]
13#[command(about = "Manage the images on the isolation engine")]
14pub struct ImageCommand {
15 #[command(subcommand)]
16 subcommand: ImageCommands,
17}
18
19impl ImageCommand {
20 pub async fn run(
21 self,
22 client: ControlServiceClient<Channel>,
23 events: EventStream,
24 ) -> Result<()> {
25 self.subcommand.run(client, events).await
26 }
27}
28
29#[derive(Subcommand)]
30pub enum ImageCommands {
31 Pull(ImagePullCommand),
32}
33
34impl ImageCommands {
35 pub async fn run(
36 self,
37 client: ControlServiceClient<Channel>,
38 _events: EventStream,
39 ) -> Result<()> {
40 match self {
41 ImageCommands::Pull(pull) => pull.run(client).await,
42 }
43 }
44}