feat: idm snooping (#71)

Implement IDM snooping, a new feature that lets you snoop on messages between guests and the host. The feature exposes the IDM packets send and receives
to the API, allowing kratactl to now listen for messages and feed them to a user for debugging purposes.
This commit is contained in:
Alex Zenla
2024-04-14 04:54:21 -07:00
committed by GitHub
parent f8247f13e4
commit 1627cbcdd7
12 changed files with 145 additions and 20 deletions

View File

@ -1,5 +1,6 @@
pub mod attach;
pub mod destroy;
pub mod idm_snoop;
pub mod launch;
pub mod list;
pub mod logs;
@ -17,8 +18,9 @@ use krata::{
use tonic::{transport::Channel, Request};
use self::{
attach::AttachCommand, destroy::DestroyCommand, launch::LauchCommand, list::ListCommand,
logs::LogsCommand, metrics::MetricsCommand, resolve::ResolveCommand, watch::WatchCommand,
attach::AttachCommand, destroy::DestroyCommand, idm_snoop::IdmSnoopCommand,
launch::LauchCommand, list::ListCommand, logs::LogsCommand, metrics::MetricsCommand,
resolve::ResolveCommand, watch::WatchCommand,
};
#[derive(Parser)]
@ -49,6 +51,7 @@ pub enum Commands {
Watch(WatchCommand),
Resolve(ResolveCommand),
Metrics(MetricsCommand),
IdmSnoop(IdmSnoopCommand),
}
impl ControlCommand {
@ -88,6 +91,10 @@ impl ControlCommand {
Commands::Metrics(metrics) => {
metrics.run(client, events).await?;
}
Commands::IdmSnoop(snoop) => {
snoop.run(client, events).await?;
}
}
Ok(())
}