mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-17 22:34:25 +01:00
kata-ctl: direct-volume: add Add and Remove handlers
This commit adds direct-volume command handlers for kata-ctl, including add, remove, stats and resize. Stats and resize makes HTTP over UDS calls to runtime-rs while add and remove runs locally on the host. Fixes #5341 Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu> kata-ctl: direct-volume: add Add and Remove handlers This commit adds direct-volume command handlers for kata-ctl, including add, remove, stats and resize. Stats and resize makes HTTP over UDS calls to runtime-rs while add and remove runs locally on the host. Fixes #5341 Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>
This commit is contained in:
@@ -20,8 +20,8 @@ pub use types::{
|
||||
GetIPTablesResponse, GuestDetailsResponse, HealthCheckResponse, IPAddress, IPFamily, Interface,
|
||||
Interfaces, ListProcessesRequest, MemHotplugByProbeRequest, OnlineCPUMemRequest,
|
||||
OomEventResponse, ReadStreamRequest, ReadStreamResponse, RemoveContainerRequest,
|
||||
ReseedRandomDevRequest, Route, Routes, SetGuestDateTimeRequest, SetIPTablesRequest,
|
||||
SetIPTablesResponse, SignalProcessRequest, StatsContainerResponse, Storage,
|
||||
ReseedRandomDevRequest, ResizeVolumeRequest, Route, Routes, SetGuestDateTimeRequest,
|
||||
SetIPTablesRequest, SetIPTablesResponse, SignalProcessRequest, StatsContainerResponse, Storage,
|
||||
TtyWinResizeRequest, UpdateContainerRequest, UpdateInterfaceRequest, UpdateRoutesRequest,
|
||||
VersionCheckResponse, WaitProcessRequest, WaitProcessResponse, WriteStreamRequest,
|
||||
WriteStreamResponse,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(PartialEq, Clone, Default)]
|
||||
pub struct Empty {}
|
||||
@@ -561,6 +561,14 @@ pub struct OomEventResponse {
|
||||
pub container_id: String,
|
||||
}
|
||||
|
||||
// ResizeVolumeRequest is also the common struct for serialization and deserialization with json
|
||||
// between shim-client HTTP calls to the shim-mgmt-server
|
||||
#[derive(Serialize, Deserialize, PartialEq, Clone, Default, Debug)]
|
||||
pub struct ResizeVolumeRequest {
|
||||
pub volume_guest_path: String,
|
||||
pub size: u64,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::convert::TryFrom;
|
||||
|
||||
Reference in New Issue
Block a user