mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 04:34:27 +00:00
runtime-rs: Bump ttrpc from 0.6.0 to 0.7.1
Fixes: #6646 Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
parent
8af6fc77cd
commit
a6b4d92c84
95
src/runtime-rs/Cargo.lock
generated
95
src/runtime-rs/Cargo.lock
generated
@ -50,7 +50,7 @@ dependencies = [
|
|||||||
"logging",
|
"logging",
|
||||||
"nix 0.24.3",
|
"nix 0.24.3",
|
||||||
"oci",
|
"oci",
|
||||||
"protobuf",
|
"protobuf 3.2.0",
|
||||||
"protocols",
|
"protocols",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@ -475,7 +475,7 @@ dependencies = [
|
|||||||
"nix 0.24.3",
|
"nix 0.24.3",
|
||||||
"oci",
|
"oci",
|
||||||
"persist",
|
"persist",
|
||||||
"protobuf",
|
"protobuf 3.2.0",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"slog",
|
"slog",
|
||||||
"slog-scope",
|
"slog-scope",
|
||||||
@ -508,13 +508,14 @@ checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "containerd-shim-protos"
|
name = "containerd-shim-protos"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "077ec778a0835d9d85502e8535362130187759b69eddabe2bdb3a68ffb575bd0"
|
checksum = "ef45f1c71aa587d8f657c546d8da38ea04f113dd05da0ef993c4515fa25fbdd1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"protobuf",
|
"protobuf 3.2.0",
|
||||||
"ttrpc",
|
"ttrpc",
|
||||||
|
"ttrpc-codegen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2192,9 +2193,16 @@ name = "protobuf"
|
|||||||
version = "2.28.0"
|
version = "2.28.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
|
checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "protobuf"
|
||||||
|
version = "3.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b55bad9126f378a853655831eb7363b7b01b81d19f8cb1218861086ca4a1a61e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"once_cell",
|
||||||
"serde_derive",
|
"protobuf-support",
|
||||||
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2203,36 +2211,47 @@ version = "2.28.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6"
|
checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"protobuf",
|
"protobuf 2.28.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "protobuf-codegen-pure"
|
name = "protobuf-codegen"
|
||||||
version = "2.28.0"
|
version = "3.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "95a29399fc94bcd3eeaa951c715f7bea69409b2445356b00519740bcd6ddd865"
|
checksum = "0dd418ac3c91caa4032d37cb80ff0d44e2ebe637b2fb243b6234bf89cdac4901"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"protobuf",
|
"anyhow",
|
||||||
"protobuf-codegen",
|
"once_cell",
|
||||||
|
"protobuf 3.2.0",
|
||||||
|
"protobuf-parse",
|
||||||
|
"regex",
|
||||||
|
"tempfile",
|
||||||
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "protobuf-codegen-pure3"
|
name = "protobuf-parse"
|
||||||
version = "2.28.2"
|
version = "3.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b351add14db0721ad0842f4858aec11a5088684112ef163fc50f113c63e69b2e"
|
checksum = "9d39b14605eaa1f6a340aec7f320b34064feb26c93aec35d6a9a2272a8ddfa49"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"protobuf",
|
"anyhow",
|
||||||
"protobuf-codegen3",
|
"indexmap",
|
||||||
|
"log",
|
||||||
|
"protobuf 3.2.0",
|
||||||
|
"protobuf-support",
|
||||||
|
"tempfile",
|
||||||
|
"thiserror",
|
||||||
|
"which",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "protobuf-codegen3"
|
name = "protobuf-support"
|
||||||
version = "2.28.2"
|
version = "3.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "73c5878d0fa872bd7d61782c6aa2d2d56761ba4ed4514eb6992f5f83162f1d2f"
|
checksum = "a5d4d7b8601c814cfb36bcebb79f0e61e45e1e93640cf778837833bbed05c372"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"protobuf",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2241,7 +2260,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"oci",
|
"oci",
|
||||||
"protobuf",
|
"protobuf 3.2.0",
|
||||||
"ttrpc",
|
"ttrpc",
|
||||||
"ttrpc-codegen",
|
"ttrpc-codegen",
|
||||||
]
|
]
|
||||||
@ -2676,7 +2695,7 @@ dependencies = [
|
|||||||
"logging",
|
"logging",
|
||||||
"nix 0.24.3",
|
"nix 0.24.3",
|
||||||
"oci",
|
"oci",
|
||||||
"protobuf",
|
"protobuf 3.2.0",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"serial_test",
|
"serial_test",
|
||||||
"service",
|
"service",
|
||||||
@ -3136,9 +3155,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ttrpc"
|
name = "ttrpc"
|
||||||
version = "0.6.1"
|
version = "0.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2ecfff459a859c6ba6668ff72b34c2f1d94d9d58f7088414c2674ad0f31cc7d8"
|
checksum = "a35f22a2964bea14afee161665bb260b83cb48e665e0260ca06ec0e775c8b06c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
@ -3146,8 +3165,8 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"nix 0.23.2",
|
"nix 0.23.2",
|
||||||
"protobuf",
|
"protobuf 3.2.0",
|
||||||
"protobuf-codegen-pure",
|
"protobuf-codegen 3.2.0",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-vsock",
|
"tokio-vsock",
|
||||||
@ -3155,28 +3174,28 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ttrpc-codegen"
|
name = "ttrpc-codegen"
|
||||||
version = "0.2.3"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2365c9179ad82b29bda1b0162c7542ab5861a7844abfedd8cfdf8bd7e12358f9"
|
checksum = "94d7f7631d7a9ebed715a47cd4cb6072cbc7ae1d4ec01598971bbec0024340c2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"protobuf",
|
"protobuf 2.28.0",
|
||||||
"protobuf-codegen-pure3",
|
"protobuf-codegen 3.2.0",
|
||||||
"protobuf-codegen3",
|
"protobuf-support",
|
||||||
"ttrpc-compiler",
|
"ttrpc-compiler",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ttrpc-compiler"
|
name = "ttrpc-compiler"
|
||||||
version = "0.4.3"
|
version = "0.6.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ed57c2d6669099791507b8b491b2940f2e8975b52a73fe82efad24257d10e9bc"
|
checksum = "ec3cb5dbf1f0865a34fe3f722290fe776cacb16f50428610b779467b76ddf647"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"derive-new",
|
"derive-new",
|
||||||
"prost",
|
"prost",
|
||||||
"prost-build",
|
"prost-build",
|
||||||
"prost-types",
|
"prost-types",
|
||||||
"protobuf",
|
"protobuf 2.28.0",
|
||||||
"protobuf-codegen3",
|
"protobuf-codegen 2.28.0",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -3297,7 +3316,7 @@ dependencies = [
|
|||||||
"nix 0.24.3",
|
"nix 0.24.3",
|
||||||
"oci",
|
"oci",
|
||||||
"persist",
|
"persist",
|
||||||
"protobuf",
|
"protobuf 3.2.0",
|
||||||
"resource",
|
"resource",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
|
@ -12,12 +12,12 @@ futures = "0.1.27"
|
|||||||
anyhow = "1.0.26"
|
anyhow = "1.0.26"
|
||||||
async-trait = "0.1.48"
|
async-trait = "0.1.48"
|
||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
protobuf = "2.27.0"
|
protobuf = "3.2.0"
|
||||||
serde = { version = "^1.0", features = ["derive"] }
|
serde = { version = "^1.0", features = ["derive"] }
|
||||||
serde_json = ">=1.0.9"
|
serde_json = ">=1.0.9"
|
||||||
slog = "2.5.2"
|
slog = "2.5.2"
|
||||||
slog-scope = "4.4.0"
|
slog-scope = "4.4.0"
|
||||||
ttrpc = { version = "0.6.1" }
|
ttrpc = { version = "0.7.1" }
|
||||||
tokio = { version = "1.8.0", features = ["fs", "rt"] }
|
tokio = { version = "1.8.0", features = ["fs", "rt"] }
|
||||||
url = "2.2.2"
|
url = "2.2.2"
|
||||||
nix = "0.24.2"
|
nix = "0.24.2"
|
||||||
|
@ -56,7 +56,7 @@ macro_rules! impl_health_service {
|
|||||||
impl HealthService for KataAgent {
|
impl HealthService for KataAgent {
|
||||||
$(async fn $name(&self, req: $req) -> Result<$resp> {
|
$(async fn $name(&self, req: $req) -> Result<$resp> {
|
||||||
let r = req.into();
|
let r = req.into();
|
||||||
let (mut client, timeout, _) = self.get_health_client().await.context("get health client")?;
|
let (client, timeout, _) = self.get_health_client().await.context("get health client")?;
|
||||||
let resp = client.$name(new_ttrpc_ctx(timeout * MILLISECOND_TO_NANOSECOND), &r).await?;
|
let resp = client.$name(new_ttrpc_ctx(timeout * MILLISECOND_TO_NANOSECOND), &r).await?;
|
||||||
Ok(resp.into())
|
Ok(resp.into())
|
||||||
})*
|
})*
|
||||||
@ -75,7 +75,7 @@ macro_rules! impl_agent {
|
|||||||
impl Agent for KataAgent {
|
impl Agent for KataAgent {
|
||||||
$(async fn $name(&self, req: $req) -> Result<$resp> {
|
$(async fn $name(&self, req: $req) -> Result<$resp> {
|
||||||
let r = req.into();
|
let r = req.into();
|
||||||
let (mut client, mut timeout, _) = self.get_agent_client().await.context("get client")?;
|
let (client, mut timeout, _) = self.get_agent_client().await.context("get client")?;
|
||||||
|
|
||||||
// update new timeout
|
// update new timeout
|
||||||
if let Some(v) = $new_timeout {
|
if let Some(v) = $new_timeout {
|
||||||
|
@ -30,30 +30,18 @@ use crate::{
|
|||||||
OomEventResponse, WaitProcessResponse, WriteStreamResponse,
|
OomEventResponse, WaitProcessResponse, WriteStreamResponse,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn from_vec<F: Into<T>, T: Sized>(from: Vec<F>) -> ::protobuf::RepeatedField<T> {
|
fn trans_vec<F: Sized + Clone, T: From<F>>(from: Vec<F>) -> Vec<T> {
|
||||||
let mut to: Vec<T> = vec![];
|
from.into_iter().map(|f| f.into()).collect()
|
||||||
for data in from {
|
|
||||||
to.push(data.into());
|
|
||||||
}
|
|
||||||
::protobuf::RepeatedField::from_vec(to)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn into_vec<F: Sized + Clone, T: From<F>>(from: ::protobuf::RepeatedField<F>) -> Vec<T> {
|
fn from_option<F: Sized, T: From<F>>(from: Option<F>) -> protobuf::MessageField<T> {
|
||||||
let mut to: Vec<T> = vec![];
|
|
||||||
for data in from.to_vec() {
|
|
||||||
to.push(data.into());
|
|
||||||
}
|
|
||||||
to
|
|
||||||
}
|
|
||||||
|
|
||||||
fn from_option<F: Sized, T: From<F>>(from: Option<F>) -> ::protobuf::SingularPtrField<T> {
|
|
||||||
match from {
|
match from {
|
||||||
Some(f) => ::protobuf::SingularPtrField::from_option(Some(T::from(f))),
|
Some(f) => protobuf::MessageField::from_option(Some(T::from(f))),
|
||||||
None => ::protobuf::SingularPtrField::none(),
|
None => protobuf::MessageField::none(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn into_option<F: Into<T>, T: Sized>(from: ::protobuf::SingularPtrField<F>) -> Option<T> {
|
fn into_option<F: Into<T>, T: Sized>(from: protobuf::MessageField<F>) -> Option<T> {
|
||||||
from.into_option().map(|f| f.into())
|
from.into_option().map(|f| f.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,9 +72,8 @@ impl From<FSGroup> for agent::FSGroup {
|
|||||||
|
|
||||||
Self {
|
Self {
|
||||||
group_id: from.group_id,
|
group_id: from.group_id,
|
||||||
group_change_policy: policy,
|
group_change_policy: policy.into(),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -96,9 +83,8 @@ impl From<StringUser> for agent::StringUser {
|
|||||||
Self {
|
Self {
|
||||||
uid: from.uid,
|
uid: from.uid,
|
||||||
gid: from.gid,
|
gid: from.gid,
|
||||||
additionalGids: ::protobuf::RepeatedField::from_vec(from.additional_gids),
|
additionalGids: from.additional_gids,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,12 +93,11 @@ impl From<Device> for agent::Device {
|
|||||||
fn from(from: Device) -> Self {
|
fn from(from: Device) -> Self {
|
||||||
Self {
|
Self {
|
||||||
id: from.id,
|
id: from.id,
|
||||||
field_type: from.field_type,
|
type_: from.field_type,
|
||||||
vm_path: from.vm_path,
|
vm_path: from.vm_path,
|
||||||
container_path: from.container_path,
|
container_path: from.container_path,
|
||||||
options: from_vec(from.options),
|
options: trans_vec(from.options),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,14 +106,13 @@ impl From<Storage> for agent::Storage {
|
|||||||
fn from(from: Storage) -> Self {
|
fn from(from: Storage) -> Self {
|
||||||
Self {
|
Self {
|
||||||
driver: from.driver,
|
driver: from.driver,
|
||||||
driver_options: from_vec(from.driver_options),
|
driver_options: trans_vec(from.driver_options),
|
||||||
source: from.source,
|
source: from.source,
|
||||||
fstype: from.fs_type,
|
fstype: from.fs_type,
|
||||||
fs_group: from_option(from.fs_group),
|
fs_group: from_option(from.fs_group),
|
||||||
options: from_vec(from.options),
|
options: trans_vec(from.options),
|
||||||
mount_point: from.mount_point,
|
mount_point: from.mount_point,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,9 +121,8 @@ impl From<KernelModule> for agent::KernelModule {
|
|||||||
fn from(from: KernelModule) -> Self {
|
fn from(from: KernelModule) -> Self {
|
||||||
Self {
|
Self {
|
||||||
name: from.name,
|
name: from.name,
|
||||||
parameters: from_vec(from.parameters),
|
parameters: trans_vec(from.parameters),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,11 +149,10 @@ impl From<types::IPFamily> for IPFamily {
|
|||||||
impl From<IPAddress> for types::IPAddress {
|
impl From<IPAddress> for types::IPAddress {
|
||||||
fn from(from: IPAddress) -> Self {
|
fn from(from: IPAddress) -> Self {
|
||||||
Self {
|
Self {
|
||||||
family: from.family.into(),
|
family: protobuf::EnumOrUnknown::new(from.family.into()),
|
||||||
address: from.address,
|
address: from.address,
|
||||||
mask: from.mask,
|
mask: from.mask,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,7 +160,7 @@ impl From<IPAddress> for types::IPAddress {
|
|||||||
impl From<types::IPAddress> for IPAddress {
|
impl From<types::IPAddress> for IPAddress {
|
||||||
fn from(src: types::IPAddress) -> Self {
|
fn from(src: types::IPAddress) -> Self {
|
||||||
Self {
|
Self {
|
||||||
family: src.family.into(),
|
family: src.family.unwrap().into(),
|
||||||
address: "".to_string(),
|
address: "".to_string(),
|
||||||
mask: "".to_string(),
|
mask: "".to_string(),
|
||||||
}
|
}
|
||||||
@ -190,14 +172,13 @@ impl From<Interface> for types::Interface {
|
|||||||
Self {
|
Self {
|
||||||
device: from.device,
|
device: from.device,
|
||||||
name: from.name,
|
name: from.name,
|
||||||
IPAddresses: from_vec(from.ip_addresses),
|
IPAddresses: trans_vec(from.ip_addresses),
|
||||||
mtu: from.mtu,
|
mtu: from.mtu,
|
||||||
hwAddr: from.hw_addr,
|
hwAddr: from.hw_addr,
|
||||||
pciPath: from.pci_addr,
|
pciPath: from.pci_addr,
|
||||||
field_type: from.field_type,
|
type_: from.field_type,
|
||||||
raw_flags: from.raw_flags,
|
raw_flags: from.raw_flags,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,11 +188,11 @@ impl From<types::Interface> for Interface {
|
|||||||
Self {
|
Self {
|
||||||
device: src.device,
|
device: src.device,
|
||||||
name: src.name,
|
name: src.name,
|
||||||
ip_addresses: into_vec(src.IPAddresses),
|
ip_addresses: trans_vec(src.IPAddresses),
|
||||||
mtu: src.mtu,
|
mtu: src.mtu,
|
||||||
hw_addr: src.hwAddr,
|
hw_addr: src.hwAddr,
|
||||||
pci_addr: src.pciPath,
|
pci_addr: src.pciPath,
|
||||||
field_type: src.field_type,
|
field_type: src.type_,
|
||||||
raw_flags: src.raw_flags,
|
raw_flags: src.raw_flags,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -220,7 +201,7 @@ impl From<types::Interface> for Interface {
|
|||||||
impl From<agent::Interfaces> for Interfaces {
|
impl From<agent::Interfaces> for Interfaces {
|
||||||
fn from(src: agent::Interfaces) -> Self {
|
fn from(src: agent::Interfaces) -> Self {
|
||||||
Self {
|
Self {
|
||||||
interfaces: into_vec(src.Interfaces),
|
interfaces: trans_vec(src.Interfaces),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,9 +214,8 @@ impl From<Route> for types::Route {
|
|||||||
device: from.device,
|
device: from.device,
|
||||||
source: from.source,
|
source: from.source,
|
||||||
scope: from.scope,
|
scope: from.scope,
|
||||||
family: from.family.into(),
|
family: protobuf::EnumOrUnknown::new(from.family.into()),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,7 +228,7 @@ impl From<types::Route> for Route {
|
|||||||
device: src.device,
|
device: src.device,
|
||||||
source: src.source,
|
source: src.source,
|
||||||
scope: src.scope,
|
scope: src.scope,
|
||||||
family: src.family.into(),
|
family: src.family.unwrap().into(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -256,9 +236,8 @@ impl From<types::Route> for Route {
|
|||||||
impl From<Routes> for agent::Routes {
|
impl From<Routes> for agent::Routes {
|
||||||
fn from(from: Routes) -> Self {
|
fn from(from: Routes) -> Self {
|
||||||
Self {
|
Self {
|
||||||
Routes: from_vec(from.routes),
|
Routes: trans_vec(from.routes),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -266,7 +245,7 @@ impl From<Routes> for agent::Routes {
|
|||||||
impl From<agent::Routes> for Routes {
|
impl From<agent::Routes> for Routes {
|
||||||
fn from(src: agent::Routes) -> Self {
|
fn from(src: agent::Routes) -> Self {
|
||||||
Self {
|
Self {
|
||||||
routes: into_vec(src.Routes),
|
routes: trans_vec(src.Routes),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -277,12 +256,11 @@ impl From<CreateContainerRequest> for agent::CreateContainerRequest {
|
|||||||
container_id: from.process_id.container_id(),
|
container_id: from.process_id.container_id(),
|
||||||
exec_id: from.process_id.exec_id(),
|
exec_id: from.process_id.exec_id(),
|
||||||
string_user: from_option(from.string_user),
|
string_user: from_option(from.string_user),
|
||||||
devices: from_vec(from.devices),
|
devices: trans_vec(from.devices),
|
||||||
storages: from_vec(from.storages),
|
storages: trans_vec(from.storages),
|
||||||
OCI: from_option(from.oci),
|
OCI: from_option(from.oci),
|
||||||
sandbox_pidns: from.sandbox_pidns,
|
sandbox_pidns: from.sandbox_pidns,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,8 +270,7 @@ impl From<RemoveContainerRequest> for agent::RemoveContainerRequest {
|
|||||||
Self {
|
Self {
|
||||||
container_id: from.container_id,
|
container_id: from.container_id,
|
||||||
timeout: from.timeout,
|
timeout: from.timeout,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -302,8 +279,7 @@ impl From<ContainerID> for agent::StartContainerRequest {
|
|||||||
fn from(from: ContainerID) -> Self {
|
fn from(from: ContainerID) -> Self {
|
||||||
Self {
|
Self {
|
||||||
container_id: from.container_id,
|
container_id: from.container_id,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -312,8 +288,7 @@ impl From<ContainerID> for agent::StatsContainerRequest {
|
|||||||
fn from(from: ContainerID) -> Self {
|
fn from(from: ContainerID) -> Self {
|
||||||
Self {
|
Self {
|
||||||
container_id: from.container_id,
|
container_id: from.container_id,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -322,8 +297,7 @@ impl From<ContainerID> for agent::PauseContainerRequest {
|
|||||||
fn from(from: ContainerID) -> Self {
|
fn from(from: ContainerID) -> Self {
|
||||||
Self {
|
Self {
|
||||||
container_id: from.container_id,
|
container_id: from.container_id,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -332,8 +306,7 @@ impl From<ContainerID> for agent::ResumeContainerRequest {
|
|||||||
fn from(from: ContainerID) -> Self {
|
fn from(from: ContainerID) -> Self {
|
||||||
Self {
|
Self {
|
||||||
container_id: from.container_id,
|
container_id: from.container_id,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -344,8 +317,7 @@ impl From<SignalProcessRequest> for agent::SignalProcessRequest {
|
|||||||
container_id: from.process_id.container_id(),
|
container_id: from.process_id.container_id(),
|
||||||
exec_id: from.process_id.exec_id(),
|
exec_id: from.process_id.exec_id(),
|
||||||
signal: from.signal,
|
signal: from.signal,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,8 +327,7 @@ impl From<WaitProcessRequest> for agent::WaitProcessRequest {
|
|||||||
Self {
|
Self {
|
||||||
container_id: from.process_id.container_id(),
|
container_id: from.process_id.container_id(),
|
||||||
exec_id: from.process_id.exec_id(),
|
exec_id: from.process_id.exec_id(),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -366,8 +337,7 @@ impl From<UpdateContainerRequest> for agent::UpdateContainerRequest {
|
|||||||
Self {
|
Self {
|
||||||
container_id: from.container_id,
|
container_id: from.container_id,
|
||||||
resources: from_option(Some(from.resources)),
|
resources: from_option(Some(from.resources)),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -378,8 +348,7 @@ impl From<WriteStreamRequest> for agent::WriteStreamRequest {
|
|||||||
container_id: from.process_id.container_id(),
|
container_id: from.process_id.container_id(),
|
||||||
exec_id: from.process_id.exec_id(),
|
exec_id: from.process_id.exec_id(),
|
||||||
data: from.data,
|
data: from.data,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -402,7 +371,7 @@ impl From<GetIPTablesRequest> for agent::GetIPTablesRequest {
|
|||||||
impl From<agent::GetIPTablesResponse> for GetIPTablesResponse {
|
impl From<agent::GetIPTablesResponse> for GetIPTablesResponse {
|
||||||
fn from(from: agent::GetIPTablesResponse) -> Self {
|
fn from(from: agent::GetIPTablesResponse) -> Self {
|
||||||
Self {
|
Self {
|
||||||
data: from.get_data().to_vec(),
|
data: from.data().to_vec(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -420,7 +389,7 @@ impl From<SetIPTablesRequest> for agent::SetIPTablesRequest {
|
|||||||
impl From<agent::SetIPTablesResponse> for SetIPTablesResponse {
|
impl From<agent::SetIPTablesResponse> for SetIPTablesResponse {
|
||||||
fn from(from: agent::SetIPTablesResponse) -> Self {
|
fn from(from: agent::SetIPTablesResponse) -> Self {
|
||||||
Self {
|
Self {
|
||||||
data: from.get_data().to_vec(),
|
data: from.data().to_vec(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,8 +401,7 @@ impl From<ExecProcessRequest> for agent::ExecProcessRequest {
|
|||||||
exec_id: from.process_id.exec_id(),
|
exec_id: from.process_id.exec_id(),
|
||||||
string_user: from_option(from.string_user),
|
string_user: from_option(from.string_user),
|
||||||
process: from_option(from.process),
|
process: from_option(from.process),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -515,14 +483,14 @@ impl From<agent::BlkioStatsEntry> for BlkioStatsEntry {
|
|||||||
impl From<agent::BlkioStats> for BlkioStats {
|
impl From<agent::BlkioStats> for BlkioStats {
|
||||||
fn from(src: agent::BlkioStats) -> Self {
|
fn from(src: agent::BlkioStats) -> Self {
|
||||||
Self {
|
Self {
|
||||||
io_service_bytes_recursive: into_vec(src.io_service_bytes_recursive),
|
io_service_bytes_recursive: trans_vec(src.io_service_bytes_recursive),
|
||||||
io_serviced_recursive: into_vec(src.io_serviced_recursive),
|
io_serviced_recursive: trans_vec(src.io_serviced_recursive),
|
||||||
io_queued_recursive: into_vec(src.io_queued_recursive),
|
io_queued_recursive: trans_vec(src.io_queued_recursive),
|
||||||
io_service_time_recursive: into_vec(src.io_service_time_recursive),
|
io_service_time_recursive: trans_vec(src.io_service_time_recursive),
|
||||||
io_wait_time_recursive: into_vec(src.io_wait_time_recursive),
|
io_wait_time_recursive: trans_vec(src.io_wait_time_recursive),
|
||||||
io_merged_recursive: into_vec(src.io_merged_recursive),
|
io_merged_recursive: trans_vec(src.io_merged_recursive),
|
||||||
io_time_recursive: into_vec(src.io_time_recursive),
|
io_time_recursive: trans_vec(src.io_time_recursive),
|
||||||
sectors_recursive: into_vec(src.sectors_recursive),
|
sectors_recursive: trans_vec(src.sectors_recursive),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -570,7 +538,7 @@ impl From<agent::StatsContainerResponse> for StatsContainerResponse {
|
|||||||
fn from(src: agent::StatsContainerResponse) -> Self {
|
fn from(src: agent::StatsContainerResponse) -> Self {
|
||||||
Self {
|
Self {
|
||||||
cgroup_stats: into_option(src.cgroup_stats),
|
cgroup_stats: into_option(src.cgroup_stats),
|
||||||
network_stats: into_vec(src.network_stats),
|
network_stats: trans_vec(src.network_stats),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -581,8 +549,7 @@ impl From<ReadStreamRequest> for agent::ReadStreamRequest {
|
|||||||
container_id: from.process_id.container_id(),
|
container_id: from.process_id.container_id(),
|
||||||
exec_id: from.process_id.exec_id(),
|
exec_id: from.process_id.exec_id(),
|
||||||
len: from.len,
|
len: from.len,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -598,8 +565,7 @@ impl From<CloseStdinRequest> for agent::CloseStdinRequest {
|
|||||||
Self {
|
Self {
|
||||||
container_id: from.process_id.container_id(),
|
container_id: from.process_id.container_id(),
|
||||||
exec_id: from.process_id.exec_id(),
|
exec_id: from.process_id.exec_id(),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -611,8 +577,7 @@ impl From<TtyWinResizeRequest> for agent::TtyWinResizeRequest {
|
|||||||
exec_id: from.process_id.exec_id(),
|
exec_id: from.process_id.exec_id(),
|
||||||
row: from.row,
|
row: from.row,
|
||||||
column: from.column,
|
column: from.column,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -621,8 +586,7 @@ impl From<UpdateInterfaceRequest> for agent::UpdateInterfaceRequest {
|
|||||||
fn from(from: UpdateInterfaceRequest) -> Self {
|
fn from(from: UpdateInterfaceRequest) -> Self {
|
||||||
Self {
|
Self {
|
||||||
interface: from_option(from.interface),
|
interface: from_option(from.interface),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -630,8 +594,7 @@ impl From<UpdateInterfaceRequest> for agent::UpdateInterfaceRequest {
|
|||||||
impl From<Empty> for agent::ListInterfacesRequest {
|
impl From<Empty> for agent::ListInterfacesRequest {
|
||||||
fn from(_: Empty) -> Self {
|
fn from(_: Empty) -> Self {
|
||||||
Self {
|
Self {
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -640,8 +603,7 @@ impl From<UpdateRoutesRequest> for agent::UpdateRoutesRequest {
|
|||||||
fn from(from: UpdateRoutesRequest) -> Self {
|
fn from(from: UpdateRoutesRequest) -> Self {
|
||||||
Self {
|
Self {
|
||||||
routes: from_option(from.route),
|
routes: from_option(from.route),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -649,8 +611,7 @@ impl From<UpdateRoutesRequest> for agent::UpdateRoutesRequest {
|
|||||||
impl From<Empty> for agent::ListRoutesRequest {
|
impl From<Empty> for agent::ListRoutesRequest {
|
||||||
fn from(_: Empty) -> Self {
|
fn from(_: Empty) -> Self {
|
||||||
Self {
|
Self {
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -663,8 +624,7 @@ impl From<ARPNeighbor> for types::ARPNeighbor {
|
|||||||
lladdr: from.ll_addr,
|
lladdr: from.ll_addr,
|
||||||
state: from.state,
|
state: from.state,
|
||||||
flags: from.flags,
|
flags: from.flags,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -672,9 +632,8 @@ impl From<ARPNeighbor> for types::ARPNeighbor {
|
|||||||
impl From<ARPNeighbors> for agent::ARPNeighbors {
|
impl From<ARPNeighbors> for agent::ARPNeighbors {
|
||||||
fn from(from: ARPNeighbors) -> Self {
|
fn from(from: ARPNeighbors) -> Self {
|
||||||
Self {
|
Self {
|
||||||
ARPNeighbors: from_vec(from.neighbors),
|
ARPNeighbors: trans_vec(from.neighbors),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -683,8 +642,7 @@ impl From<AddArpNeighborRequest> for agent::AddARPNeighborsRequest {
|
|||||||
fn from(from: AddArpNeighborRequest) -> Self {
|
fn from(from: AddArpNeighborRequest) -> Self {
|
||||||
Self {
|
Self {
|
||||||
neighbors: from_option(from.neighbors),
|
neighbors: from_option(from.neighbors),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -693,14 +651,13 @@ impl From<CreateSandboxRequest> for agent::CreateSandboxRequest {
|
|||||||
fn from(from: CreateSandboxRequest) -> Self {
|
fn from(from: CreateSandboxRequest) -> Self {
|
||||||
Self {
|
Self {
|
||||||
hostname: from.hostname,
|
hostname: from.hostname,
|
||||||
dns: from_vec(from.dns),
|
dns: trans_vec(from.dns),
|
||||||
storages: from_vec(from.storages),
|
storages: trans_vec(from.storages),
|
||||||
sandbox_pidns: from.sandbox_pidns,
|
sandbox_pidns: from.sandbox_pidns,
|
||||||
sandbox_id: from.sandbox_id,
|
sandbox_id: from.sandbox_id,
|
||||||
guest_hook_path: from.guest_hook_path,
|
guest_hook_path: from.guest_hook_path,
|
||||||
kernel_modules: from_vec(from.kernel_modules),
|
kernel_modules: trans_vec(from.kernel_modules),
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -708,8 +665,7 @@ impl From<CreateSandboxRequest> for agent::CreateSandboxRequest {
|
|||||||
impl From<Empty> for agent::DestroySandboxRequest {
|
impl From<Empty> for agent::DestroySandboxRequest {
|
||||||
fn from(_: Empty) -> Self {
|
fn from(_: Empty) -> Self {
|
||||||
Self {
|
Self {
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -720,8 +676,7 @@ impl From<OnlineCPUMemRequest> for agent::OnlineCPUMemRequest {
|
|||||||
wait: from.wait,
|
wait: from.wait,
|
||||||
nb_cpus: from.nb_cpus,
|
nb_cpus: from.nb_cpus,
|
||||||
cpu_only: from.cpu_only,
|
cpu_only: from.cpu_only,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -730,8 +685,7 @@ impl From<ReseedRandomDevRequest> for agent::ReseedRandomDevRequest {
|
|||||||
fn from(from: ReseedRandomDevRequest) -> Self {
|
fn from(from: ReseedRandomDevRequest) -> Self {
|
||||||
Self {
|
Self {
|
||||||
data: from.data,
|
data: from.data,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -740,8 +694,7 @@ impl From<MemHotplugByProbeRequest> for agent::MemHotplugByProbeRequest {
|
|||||||
fn from(from: MemHotplugByProbeRequest) -> Self {
|
fn from(from: MemHotplugByProbeRequest) -> Self {
|
||||||
Self {
|
Self {
|
||||||
memHotplugProbeAddr: from.mem_hotplug_probe_addr,
|
memHotplugProbeAddr: from.mem_hotplug_probe_addr,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -751,8 +704,7 @@ impl From<SetGuestDateTimeRequest> for agent::SetGuestDateTimeRequest {
|
|||||||
Self {
|
Self {
|
||||||
Sec: from.sec,
|
Sec: from.sec,
|
||||||
Usec: from.usec,
|
Usec: from.usec,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -762,8 +714,8 @@ impl From<agent::AgentDetails> for AgentDetails {
|
|||||||
Self {
|
Self {
|
||||||
version: src.version,
|
version: src.version,
|
||||||
init_daemon: src.init_daemon,
|
init_daemon: src.init_daemon,
|
||||||
device_handlers: into_vec(src.device_handlers),
|
device_handlers: trans_vec(src.device_handlers),
|
||||||
storage_handlers: into_vec(src.storage_handlers),
|
storage_handlers: trans_vec(src.storage_handlers),
|
||||||
supports_seccomp: src.supports_seccomp,
|
supports_seccomp: src.supports_seccomp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -790,8 +742,7 @@ impl From<CopyFileRequest> for agent::CopyFileRequest {
|
|||||||
gid: from.gid,
|
gid: from.gid,
|
||||||
offset: from.offset,
|
offset: from.offset,
|
||||||
data: from.data,
|
data: from.data,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -807,8 +758,7 @@ impl From<agent::WaitProcessResponse> for WaitProcessResponse {
|
|||||||
impl From<Empty> for agent::GetOOMEventRequest {
|
impl From<Empty> for agent::GetOOMEventRequest {
|
||||||
fn from(_: Empty) -> Self {
|
fn from(_: Empty) -> Self {
|
||||||
Self {
|
Self {
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -817,8 +767,7 @@ impl From<CheckRequest> for health::CheckRequest {
|
|||||||
fn from(from: CheckRequest) -> Self {
|
fn from(from: CheckRequest) -> Self {
|
||||||
Self {
|
Self {
|
||||||
service: from.service,
|
service: from.service,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -826,7 +775,7 @@ impl From<CheckRequest> for health::CheckRequest {
|
|||||||
impl From<health::HealthCheckResponse> for HealthCheckResponse {
|
impl From<health::HealthCheckResponse> for HealthCheckResponse {
|
||||||
fn from(from: health::HealthCheckResponse) -> Self {
|
fn from(from: health::HealthCheckResponse) -> Self {
|
||||||
Self {
|
Self {
|
||||||
status: from.status as u32,
|
status: from.status.value() as u32,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -852,8 +801,7 @@ impl From<VolumeStatsRequest> for agent::VolumeStatsRequest {
|
|||||||
fn from(from: VolumeStatsRequest) -> Self {
|
fn from(from: VolumeStatsRequest) -> Self {
|
||||||
Self {
|
Self {
|
||||||
volume_guest_path: from.volume_guest_path,
|
volume_guest_path: from.volume_guest_path,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -862,8 +810,8 @@ impl From<csi::VolumeStatsResponse> for VolumeStatsResponse {
|
|||||||
fn from(from: csi::VolumeStatsResponse) -> Self {
|
fn from(from: csi::VolumeStatsResponse) -> Self {
|
||||||
let result: String = format!(
|
let result: String = format!(
|
||||||
"Usage: {:?} Volume Condition: {:?}",
|
"Usage: {:?} Volume Condition: {:?}",
|
||||||
from.get_usage(),
|
from.usage(),
|
||||||
from.get_volume_condition()
|
from.volume_condition()
|
||||||
);
|
);
|
||||||
Self { data: result }
|
Self { data: result }
|
||||||
}
|
}
|
||||||
@ -874,8 +822,7 @@ impl From<ResizeVolumeRequest> for agent::ResizeVolumeRequest {
|
|||||||
Self {
|
Self {
|
||||||
volume_guest_path: from.volume_guest_path,
|
volume_guest_path: from.volume_guest_path,
|
||||||
size: from.size,
|
size: from.size,
|
||||||
unknown_fields: Default::default(),
|
..Default::default()
|
||||||
cached_size: Default::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,17 +10,17 @@ license = "Apache-2.0"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "^1.0"
|
anyhow = "^1.0"
|
||||||
async-trait = "0.1.48"
|
async-trait = "0.1.48"
|
||||||
containerd-shim-protos = { version = "0.2.0", features = ["async"]}
|
containerd-shim-protos = { version = "0.3.0", features = ["async"]}
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
nix = "0.24.2"
|
nix = "0.24.2"
|
||||||
protobuf = "2.27.0"
|
protobuf = "3.2.0"
|
||||||
serde_json = "1.0.39"
|
serde_json = "1.0.39"
|
||||||
slog = "2.5.2"
|
slog = "2.5.2"
|
||||||
slog-scope = "4.4.0"
|
slog-scope = "4.4.0"
|
||||||
strum = { version = "0.24.0", features = ["derive"] }
|
strum = { version = "0.24.0", features = ["derive"] }
|
||||||
thiserror = "^1.0"
|
thiserror = "^1.0"
|
||||||
tokio = { version = "1.8.0", features = ["rt-multi-thread", "process", "fs"] }
|
tokio = { version = "1.8.0", features = ["rt-multi-thread", "process", "fs"] }
|
||||||
ttrpc = { version = "0.6.1" }
|
ttrpc = { version = "0.7.1" }
|
||||||
persist = {path = "../../persist"}
|
persist = {path = "../../persist"}
|
||||||
agent = { path = "../../agent" }
|
agent = { path = "../../agent" }
|
||||||
kata-sys-util = { path = "../../../../libs/kata-sys-util" }
|
kata-sys-util = { path = "../../../../libs/kata-sys-util" }
|
||||||
|
@ -151,7 +151,7 @@ impl From<Option<agent::StatsContainerResponse>> for StatsInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !cg_stats.hugetlb_stats.is_empty() {
|
if !cg_stats.hugetlb_stats.is_empty() {
|
||||||
let mut p_huge = ::protobuf::RepeatedField::new();
|
let mut p_huge = Vec::new();
|
||||||
for (k, v) in cg_stats.hugetlb_stats {
|
for (k, v) in cg_stats.hugetlb_stats {
|
||||||
let mut h = metrics::HugetlbStat::new();
|
let mut h = metrics::HugetlbStat::new();
|
||||||
h.set_pagesize(k);
|
h.set_pagesize(k);
|
||||||
@ -166,7 +166,7 @@ impl From<Option<agent::StatsContainerResponse>> for StatsInfo {
|
|||||||
|
|
||||||
let net_stats = stats.network_stats;
|
let net_stats = stats.network_stats;
|
||||||
if !net_stats.is_empty() {
|
if !net_stats.is_empty() {
|
||||||
let mut p_net = ::protobuf::RepeatedField::new();
|
let mut p_net = Vec::new();
|
||||||
for v in net_stats.iter() {
|
for v in net_stats.iter() {
|
||||||
let mut h = metrics::NetworkStat::new();
|
let mut h = metrics::NetworkStat::new();
|
||||||
h.set_name(v.name.clone());
|
h.set_name(v.name.clone());
|
||||||
@ -195,10 +195,8 @@ impl From<Option<agent::StatsContainerResponse>> for StatsInfo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn copy_blkio_entry(
|
fn copy_blkio_entry(entry: &[agent::BlkioStatsEntry]) -> Vec<metrics::BlkIOEntry> {
|
||||||
entry: &[agent::BlkioStatsEntry],
|
let mut p_entry = Vec::new();
|
||||||
) -> ::protobuf::RepeatedField<metrics::BlkIOEntry> {
|
|
||||||
let mut p_entry = ::protobuf::RepeatedField::new();
|
|
||||||
|
|
||||||
for e in entry.iter() {
|
for e in entry.iter() {
|
||||||
let mut blk = metrics::BlkIOEntry::new();
|
let mut blk = metrics::BlkIOEntry::new();
|
||||||
|
@ -16,7 +16,7 @@ use std::{
|
|||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn trans_from_shim_mount(from: api::Mount) -> Mount {
|
fn trans_from_shim_mount(from: &api::Mount) -> Mount {
|
||||||
let options = from.options.to_vec();
|
let options = from.options.to_vec();
|
||||||
let mut read_only = false;
|
let mut read_only = false;
|
||||||
for o in &options {
|
for o in &options {
|
||||||
@ -29,7 +29,7 @@ fn trans_from_shim_mount(from: api::Mount) -> Mount {
|
|||||||
Mount {
|
Mount {
|
||||||
source: from.source.clone(),
|
source: from.source.clone(),
|
||||||
destination: PathBuf::from(&from.target),
|
destination: PathBuf::from(&from.target),
|
||||||
fs_type: from.field_type,
|
fs_type: from.type_.clone(),
|
||||||
options,
|
options,
|
||||||
device_id: None,
|
device_id: None,
|
||||||
host_shared_fs_path: None,
|
host_shared_fs_path: None,
|
||||||
@ -41,19 +41,14 @@ impl TryFrom<api::CreateTaskRequest> for Request {
|
|||||||
type Error = anyhow::Error;
|
type Error = anyhow::Error;
|
||||||
fn try_from(from: api::CreateTaskRequest) -> Result<Self> {
|
fn try_from(from: api::CreateTaskRequest) -> Result<Self> {
|
||||||
let options = if from.has_options() {
|
let options = if from.has_options() {
|
||||||
Some(from.get_options().get_value().to_vec())
|
Some(from.options().value.to_vec())
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
Ok(Request::CreateContainer(ContainerConfig {
|
Ok(Request::CreateContainer(ContainerConfig {
|
||||||
container_id: from.id.clone(),
|
container_id: from.id.clone(),
|
||||||
bundle: from.bundle.clone(),
|
bundle: from.bundle.clone(),
|
||||||
rootfs_mounts: from
|
rootfs_mounts: from.rootfs.iter().map(trans_from_shim_mount).collect(),
|
||||||
.rootfs
|
|
||||||
.to_vec()
|
|
||||||
.into_iter()
|
|
||||||
.map(trans_from_shim_mount)
|
|
||||||
.collect(),
|
|
||||||
terminal: from.terminal,
|
terminal: from.terminal,
|
||||||
options,
|
options,
|
||||||
stdin: (!from.stdin.is_empty()).then(|| from.stdin.clone()),
|
stdin: (!from.stdin.is_empty()).then(|| from.stdin.clone()),
|
||||||
@ -84,15 +79,15 @@ impl TryFrom<api::DeleteRequest> for Request {
|
|||||||
impl TryFrom<api::ExecProcessRequest> for Request {
|
impl TryFrom<api::ExecProcessRequest> for Request {
|
||||||
type Error = anyhow::Error;
|
type Error = anyhow::Error;
|
||||||
fn try_from(from: api::ExecProcessRequest) -> Result<Self> {
|
fn try_from(from: api::ExecProcessRequest) -> Result<Self> {
|
||||||
let spec = from.get_spec();
|
let spec = from.spec();
|
||||||
Ok(Request::ExecProcess(ExecProcessRequest {
|
Ok(Request::ExecProcess(ExecProcessRequest {
|
||||||
process: ContainerProcess::new(&from.id, &from.exec_id).context("new process id")?,
|
process: ContainerProcess::new(&from.id, &from.exec_id).context("new process id")?,
|
||||||
terminal: from.terminal,
|
terminal: from.terminal,
|
||||||
stdin: (!from.stdin.is_empty()).then(|| from.stdin.clone()),
|
stdin: (!from.stdin.is_empty()).then(|| from.stdin.clone()),
|
||||||
stdout: (!from.stdout.is_empty()).then(|| from.stdout.clone()),
|
stdout: (!from.stdout.is_empty()).then(|| from.stdout.clone()),
|
||||||
stderr: (!from.stderr.is_empty()).then(|| from.stderr.clone()),
|
stderr: (!from.stderr.is_empty()).then(|| from.stderr.clone()),
|
||||||
spec_type_url: spec.get_type_url().to_string(),
|
spec_type_url: spec.type_url.to_string(),
|
||||||
spec_value: spec.get_value().to_vec(),
|
spec_value: spec.value.to_vec(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -182,7 +177,7 @@ impl TryFrom<api::UpdateTaskRequest> for Request {
|
|||||||
fn try_from(from: api::UpdateTaskRequest) -> Result<Self> {
|
fn try_from(from: api::UpdateTaskRequest) -> Result<Self> {
|
||||||
Ok(Request::UpdateContainer(UpdateRequest {
|
Ok(Request::UpdateContainer(UpdateRequest {
|
||||||
container_id: from.id.to_string(),
|
container_id: from.id.to_string(),
|
||||||
value: from.get_resources().get_value().to_vec(),
|
value: from.resources().value.to_vec(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,24 +16,24 @@ use containerd_shim_protos::api;
|
|||||||
use super::{ProcessExitStatus, ProcessStateInfo, ProcessStatus, Response};
|
use super::{ProcessExitStatus, ProcessStateInfo, ProcessStatus, Response};
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
|
|
||||||
fn system_time_into(time: time::SystemTime) -> ::protobuf::well_known_types::Timestamp {
|
fn system_time_into(time: time::SystemTime) -> ::protobuf::well_known_types::timestamp::Timestamp {
|
||||||
let mut proto_time = ::protobuf::well_known_types::Timestamp::new();
|
let mut proto_time = ::protobuf::well_known_types::timestamp::Timestamp::new();
|
||||||
proto_time.set_seconds(
|
proto_time.seconds = time
|
||||||
time.duration_since(time::UNIX_EPOCH)
|
.duration_since(time::UNIX_EPOCH)
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.as_secs()
|
.as_secs()
|
||||||
.try_into()
|
.try_into()
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default();
|
||||||
);
|
|
||||||
proto_time
|
proto_time
|
||||||
}
|
}
|
||||||
|
|
||||||
fn option_system_time_into(
|
fn option_system_time_into(
|
||||||
time: Option<time::SystemTime>,
|
time: Option<time::SystemTime>,
|
||||||
) -> ::protobuf::SingularPtrField<::protobuf::well_known_types::Timestamp> {
|
) -> protobuf::MessageField<protobuf::well_known_types::timestamp::Timestamp> {
|
||||||
match time {
|
match time {
|
||||||
Some(v) => ::protobuf::SingularPtrField::some(system_time_into(v)),
|
Some(v) => ::protobuf::MessageField::some(system_time_into(v)),
|
||||||
None => ::protobuf::SingularPtrField::none(),
|
None => ::protobuf::MessageField::none(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ impl From<ProcessStateInfo> for api::StateResponse {
|
|||||||
id: from.container_id.clone(),
|
id: from.container_id.clone(),
|
||||||
bundle: from.bundle.clone(),
|
bundle: from.bundle.clone(),
|
||||||
pid: from.pid.pid,
|
pid: from.pid.pid,
|
||||||
status: from.status.into(),
|
status: protobuf::EnumOrUnknown::new(from.status.into()),
|
||||||
stdin: from.stdin.unwrap_or_default(),
|
stdin: from.stdin.unwrap_or_default(),
|
||||||
stdout: from.stdout.unwrap_or_default(),
|
stdout: from.stdout.unwrap_or_default(),
|
||||||
stderr: from.stderr.unwrap_or_default(),
|
stderr: from.stderr.unwrap_or_default(),
|
||||||
@ -164,13 +164,13 @@ impl TryFrom<Response> for api::StateResponse {
|
|||||||
impl TryFrom<Response> for api::StatsResponse {
|
impl TryFrom<Response> for api::StatsResponse {
|
||||||
type Error = anyhow::Error;
|
type Error = anyhow::Error;
|
||||||
fn try_from(from: Response) -> Result<Self> {
|
fn try_from(from: Response) -> Result<Self> {
|
||||||
let mut any = ::protobuf::well_known_types::Any::new();
|
let mut any = ::protobuf::well_known_types::any::Any::new();
|
||||||
let mut response = api::StatsResponse::new();
|
let mut response = api::StatsResponse::new();
|
||||||
match from {
|
match from {
|
||||||
Response::StatsContainer(resp) => {
|
Response::StatsContainer(resp) => {
|
||||||
if let Some(value) = resp.value {
|
if let Some(value) = resp.value {
|
||||||
any.set_type_url(value.type_url);
|
any.type_url = value.type_url;
|
||||||
any.set_value(value.value);
|
any.value = value.value;
|
||||||
response.set_stats(any);
|
response.set_stats(any);
|
||||||
}
|
}
|
||||||
Ok(response)
|
Ok(response)
|
||||||
@ -193,8 +193,7 @@ impl TryFrom<Response> for api::PidsResponse {
|
|||||||
let mut res = api::PidsResponse::new();
|
let mut res = api::PidsResponse::new();
|
||||||
p_info.set_pid(resp.pid);
|
p_info.set_pid(resp.pid);
|
||||||
processes.push(p_info);
|
processes.push(p_info);
|
||||||
let v = protobuf::RepeatedField::<api::ProcessInfo>::from_vec(processes);
|
res.set_processes(processes);
|
||||||
res.set_processes(v);
|
|
||||||
Ok(res)
|
Ok(res)
|
||||||
}
|
}
|
||||||
_ => Err(anyhow!(Error::UnexpectedResponse(
|
_ => Err(anyhow!(Error::UnexpectedResponse(
|
||||||
|
@ -9,12 +9,12 @@ license = "Apache-2.0"
|
|||||||
anyhow = "^1.0"
|
anyhow = "^1.0"
|
||||||
async-trait = "0.1.48"
|
async-trait = "0.1.48"
|
||||||
awaitgroup = "0.6.0"
|
awaitgroup = "0.6.0"
|
||||||
containerd-shim-protos = { version = "0.2.0", features = ["async"]}
|
containerd-shim-protos = { version = "0.3.0", features = ["async"]}
|
||||||
futures = "0.3.19"
|
futures = "0.3.19"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
libc = ">=0.2.39"
|
libc = ">=0.2.39"
|
||||||
nix = "0.24.2"
|
nix = "0.24.2"
|
||||||
protobuf = "2.27.0"
|
protobuf = "3.2.0"
|
||||||
serde = { version = "1.0.100", features = ["derive"] }
|
serde = { version = "1.0.100", features = ["derive"] }
|
||||||
serde_derive = "1.0.27"
|
serde_derive = "1.0.27"
|
||||||
serde_json = "1.0.82"
|
serde_json = "1.0.82"
|
||||||
|
@ -11,10 +11,10 @@ async-trait = "0.1.48"
|
|||||||
slog = "2.5.2"
|
slog = "2.5.2"
|
||||||
slog-scope = "4.4.0"
|
slog-scope = "4.4.0"
|
||||||
tokio = { version = "1.8.0", features = ["rt-multi-thread"] }
|
tokio = { version = "1.8.0", features = ["rt-multi-thread"] }
|
||||||
ttrpc = { version = "0.6.1" }
|
ttrpc = { version = "0.7.1" }
|
||||||
|
|
||||||
common = { path = "../runtimes/common" }
|
common = { path = "../runtimes/common" }
|
||||||
containerd-shim-protos = { version = "0.2.0", features = ["async"]}
|
containerd-shim-protos = { version = "0.3.0", features = ["async"]}
|
||||||
logging = { path = "../../../libs/logging"}
|
logging = { path = "../../../libs/logging"}
|
||||||
shim-interface = { path = "../../../libs/shim-interface" }
|
shim-interface = { path = "../../../libs/shim-interface" }
|
||||||
runtimes = { path = "../runtimes" }
|
runtimes = { path = "../runtimes" }
|
||||||
|
@ -14,7 +14,7 @@ use std::{
|
|||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use common::message::{Action, Event, Message};
|
use common::message::{Action, Event, Message};
|
||||||
use containerd_shim_protos::{
|
use containerd_shim_protos::{
|
||||||
protobuf::{well_known_types::Any, Message as ProtobufMessage},
|
protobuf::{well_known_types::any::Any, Message as ProtobufMessage},
|
||||||
shim_async,
|
shim_async,
|
||||||
};
|
};
|
||||||
use runtimes::RuntimeHandlerManager;
|
use runtimes::RuntimeHandlerManager;
|
||||||
|
@ -15,12 +15,12 @@ path = "src/bin/main.rs"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "^1.0"
|
anyhow = "^1.0"
|
||||||
backtrace = {version = ">=0.3.35", features = ["libunwind", "libbacktrace", "std"], default-features = false}
|
backtrace = {version = ">=0.3.35", features = ["libunwind", "libbacktrace", "std"], default-features = false}
|
||||||
containerd-shim-protos = { version = "0.2.0", features = ["async"]}
|
containerd-shim-protos = { version = "0.3.0", features = ["async"]}
|
||||||
go-flag = "0.1.0"
|
go-flag = "0.1.0"
|
||||||
libc = "0.2.108"
|
libc = "0.2.108"
|
||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
nix = "0.24.2"
|
nix = "0.24.2"
|
||||||
protobuf = "2.27.0"
|
protobuf = "3.2.0"
|
||||||
sha2 = "=0.9.3"
|
sha2 = "=0.9.3"
|
||||||
slog = {version = "2.5.2", features = ["std", "release_max_level_trace", "max_level_trace"]}
|
slog = {version = "2.5.2", features = ["std", "release_max_level_trace", "max_level_trace"]}
|
||||||
slog-async = "2.5.2"
|
slog-async = "2.5.2"
|
||||||
|
@ -26,12 +26,12 @@ impl ShimExecutor {
|
|||||||
async fn do_cleanup(&self) -> Result<api::DeleteResponse> {
|
async fn do_cleanup(&self) -> Result<api::DeleteResponse> {
|
||||||
let mut rsp = api::DeleteResponse::new();
|
let mut rsp = api::DeleteResponse::new();
|
||||||
rsp.set_exit_status(128 + libc::SIGKILL as u32);
|
rsp.set_exit_status(128 + libc::SIGKILL as u32);
|
||||||
let mut exited_time = protobuf::well_known_types::Timestamp::new();
|
let mut exited_time = protobuf::well_known_types::timestamp::Timestamp::new();
|
||||||
let seconds = std::time::SystemTime::now()
|
let seconds = std::time::SystemTime::now()
|
||||||
.duration_since(std::time::UNIX_EPOCH)
|
.duration_since(std::time::UNIX_EPOCH)
|
||||||
.map_err(Error::SystemTime)?
|
.map_err(Error::SystemTime)?
|
||||||
.as_secs() as i64;
|
.as_secs() as i64;
|
||||||
exited_time.set_seconds(seconds);
|
exited_time.seconds = seconds;
|
||||||
rsp.set_exited_at(exited_time);
|
rsp.set_exited_at(exited_time);
|
||||||
|
|
||||||
let address = self
|
let address = self
|
||||||
|
Loading…
Reference in New Issue
Block a user