mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-24 01:24:26 +01:00
runtime-rs: add the missing default trait
Some structs in the runtime-rs don't implement Default trait. This commit adds the missing Default. Fixes: #5463 Signed-off-by: Li Hongyu <lihongyu1999@bupt.edu.cn>
This commit is contained in:
@@ -9,6 +9,8 @@ use std::convert::TryFrom;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub const DEFAULT_REMOVE_CONTAINER_REQUEST_TIMEOUT: u32 = 10;
|
||||
|
||||
#[derive(PartialEq, Clone, Default)]
|
||||
pub struct Empty {}
|
||||
|
||||
@@ -164,7 +166,7 @@ impl ContainerProcessID {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Debug, Default)]
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
pub struct RemoveContainerRequest {
|
||||
pub container_id: String,
|
||||
pub timeout: u32,
|
||||
@@ -179,6 +181,15 @@ impl RemoveContainerRequest {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::default::Default for RemoveContainerRequest {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
container_id: "".to_string(),
|
||||
timeout: DEFAULT_REMOVE_CONTAINER_REQUEST_TIMEOUT,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Default)]
|
||||
pub struct SignalProcessRequest {
|
||||
pub process_id: ContainerProcessID,
|
||||
|
||||
Reference in New Issue
Block a user