mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-19 07:14:22 +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:
@@ -117,12 +117,11 @@ mod tests {
|
||||
result: Result<()>,
|
||||
}
|
||||
|
||||
let default_id = "1dfc0567".to_string();
|
||||
let default_namespace = "ns1".to_string();
|
||||
let default_id = "default_id".to_string();
|
||||
let default_namespace = "default_namespace".to_string();
|
||||
let default_address = bind_address.to_string();
|
||||
let default_publish_binary = "containerd".to_string();
|
||||
let default_bundle = path.to_string();
|
||||
let default_debug = false;
|
||||
|
||||
let mut arg = Args {
|
||||
id: default_id.clone(),
|
||||
@@ -130,7 +129,7 @@ mod tests {
|
||||
address: default_address.clone(),
|
||||
publish_binary: default_publish_binary.clone(),
|
||||
bundle: default_bundle.clone(),
|
||||
debug: default_debug,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let tests = &[
|
||||
|
||||
@@ -93,12 +93,12 @@ mod tests {
|
||||
std::env::set_current_dir(bundle_path).unwrap();
|
||||
|
||||
let args = Args {
|
||||
id: "1dfc0567".to_string(),
|
||||
namespace: "test_namespace".into(),
|
||||
address: "containerd_socket".into(),
|
||||
id: "default_id".into(),
|
||||
namespace: "default_namespace".into(),
|
||||
address: "default_address".into(),
|
||||
publish_binary: "containerd".into(),
|
||||
bundle: bundle_path.to_str().unwrap().into(),
|
||||
debug: false,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let executor = ShimExecutor::new(args);
|
||||
|
||||
@@ -153,12 +153,12 @@ mod tests {
|
||||
std::env::set_current_dir(bundle_path).unwrap();
|
||||
|
||||
let args = Args {
|
||||
id: "sandbox1".into(),
|
||||
namespace: "ns".into(),
|
||||
address: "address".into(),
|
||||
id: "default_id".into(),
|
||||
namespace: "default_namespace".into(),
|
||||
address: "default_address".into(),
|
||||
publish_binary: "containerd".into(),
|
||||
bundle: bundle_path.to_str().unwrap().into(),
|
||||
debug: false,
|
||||
..Default::default()
|
||||
};
|
||||
let mut executor = ShimExecutor::new(args);
|
||||
|
||||
@@ -185,11 +185,11 @@ mod tests {
|
||||
|
||||
let args = Args {
|
||||
id: sandbox_id.to_owned(),
|
||||
namespace: "ns1".into(),
|
||||
address: "containerd_socket".into(),
|
||||
namespace: "default_namespace".into(),
|
||||
address: "default_address".into(),
|
||||
publish_binary: "containerd".into(),
|
||||
bundle: bundle_path.to_str().unwrap().into(),
|
||||
debug: false,
|
||||
..Default::default()
|
||||
};
|
||||
let executor = ShimExecutor::new(args);
|
||||
|
||||
@@ -204,11 +204,11 @@ mod tests {
|
||||
|
||||
let args = Args {
|
||||
id: container_id,
|
||||
namespace: "ns1".into(),
|
||||
address: "containerd_socket".into(),
|
||||
namespace: "default_namespace".into(),
|
||||
address: "default_address".into(),
|
||||
publish_binary: "containerd".into(),
|
||||
bundle: bundle_path2.to_str().unwrap().into(),
|
||||
debug: false,
|
||||
..Default::default()
|
||||
};
|
||||
let executor2 = ShimExecutor::new(args);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user