From b1b78a79b7aaa74cc3169b50e1d45f6f0e931491 Mon Sep 17 00:00:00 2001 From: Aditya R Date: Fri, 26 Aug 2022 12:42:16 +0530 Subject: [PATCH] rust,runtime: rename GidMapping,UidMapping to Linux{Uid/Gid}Mapping Signed-off-by: Aditya R --- diff | 95 ++++++++++++++++++++++++++++++++++++++++++++++ src/runtime/mod.rs | 8 ++-- 2 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 diff diff --git a/diff b/diff new file mode 100644 index 00000000..a65e5e39 --- /dev/null +++ b/diff @@ -0,0 +1,95 @@ +diff --git a/src/runtime/mod.rs b/src/runtime/mod.rs +index ea2a6ff..f5c9d39 100644 +--- a/src/runtime/mod.rs ++++ b/src/runtime/mod.rs +@@ -183,7 +183,7 @@ pub struct Linux { + pub devices: Option>, + + #[serde(rename = "gidMappings")] +- pub gid_mappings: Option>, ++ pub gid_mappings: Option>, + + #[serde(rename = "intelRdt")] + pub intel_rdt: Option, +@@ -216,7 +216,7 @@ pub struct Linux { + pub sysctl: Option>>, + + #[serde(rename = "uidMappings")] +- pub uid_mappings: Option>, ++ pub uid_mappings: Option>, + } + + #[derive(Serialize, Deserialize)] +@@ -248,7 +248,7 @@ pub struct LinuxDevice { + } + + #[derive(Serialize, Deserialize)] +-pub struct GidMapping { ++pub struct LinuxGidMapping { + #[serde(rename = "containerID")] + pub container_id: i64, + +@@ -427,6 +427,9 @@ pub struct PurpleCpu { + #[serde(rename = "cpus")] + pub cpus: Option, + ++ #[serde(rename = "idle")] ++ pub idle: Option, ++ + #[serde(rename = "mems")] + pub mems: Option, + +@@ -590,7 +593,7 @@ pub struct Arg { + } + + #[derive(Serialize, Deserialize)] +-pub struct UidMapping { ++pub struct LinuxUidMapping { + #[serde(rename = "containerID")] + pub container_id: i64, + +@@ -606,6 +609,9 @@ pub struct Mount { + #[serde(rename = "destination")] + pub destination: String, + ++ #[serde(rename = "gidMappings")] ++ pub gid_mappings: Option>, ++ + #[serde(rename = "options")] + pub options: Option>, + +@@ -614,6 +620,33 @@ pub struct Mount { + + #[serde(rename = "type")] + pub mount_type: Option, ++ ++ #[serde(rename = "uidMappings")] ++ pub uid_mappings: Option>, ++} ++ ++#[derive(Serialize, Deserialize)] ++pub struct MountGidMapping { ++ #[serde(rename = "containerID")] ++ pub container_id: i64, ++ ++ #[serde(rename = "hostID")] ++ pub host_id: i64, ++ ++ #[serde(rename = "size")] ++ pub size: i64, ++} ++ ++#[derive(Serialize, Deserialize)] ++pub struct MountUidMapping { ++ #[serde(rename = "containerID")] ++ pub container_id: i64, ++ ++ #[serde(rename = "hostID")] ++ pub host_id: i64, ++ ++ #[serde(rename = "size")] ++ pub size: i64, + } + + #[derive(Serialize, Deserialize)] + diff --git a/src/runtime/mod.rs b/src/runtime/mod.rs index ea2a6ffd..e5639593 100644 --- a/src/runtime/mod.rs +++ b/src/runtime/mod.rs @@ -183,7 +183,7 @@ pub struct Linux { pub devices: Option>, #[serde(rename = "gidMappings")] - pub gid_mappings: Option>, + pub gid_mappings: Option>, #[serde(rename = "intelRdt")] pub intel_rdt: Option, @@ -216,7 +216,7 @@ pub struct Linux { pub sysctl: Option>>, #[serde(rename = "uidMappings")] - pub uid_mappings: Option>, + pub uid_mappings: Option>, } #[derive(Serialize, Deserialize)] @@ -248,7 +248,7 @@ pub struct LinuxDevice { } #[derive(Serialize, Deserialize)] -pub struct GidMapping { +pub struct LinuxGidMapping { #[serde(rename = "containerID")] pub container_id: i64, @@ -590,7 +590,7 @@ pub struct Arg { } #[derive(Serialize, Deserialize)] -pub struct UidMapping { +pub struct LinuxUidMapping { #[serde(rename = "containerID")] pub container_id: i64,