Skip to content

Commit

Permalink
rust,runtime: rename GidMapping,UidMapping to Linux{Uid/Gid}Mapping
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya R <arajan@redhat.com>
  • Loading branch information
flouthoc committed Aug 26, 2022
1 parent 3254687 commit b1b78a7
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 4 deletions.
95 changes: 95 additions & 0 deletions diff
Original file line number Diff line number Diff line change
@@ -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<Vec<LinuxDevice>>,

#[serde(rename = "gidMappings")]
- pub gid_mappings: Option<Vec<GidMapping>>,
+ pub gid_mappings: Option<Vec<LinuxGidMapping>>,

#[serde(rename = "intelRdt")]
pub intel_rdt: Option<IntelRdt>,
@@ -216,7 +216,7 @@ pub struct Linux {
pub sysctl: Option<HashMap<String, Option<serde_json::Value>>>,

#[serde(rename = "uidMappings")]
- pub uid_mappings: Option<Vec<UidMapping>>,
+ pub uid_mappings: Option<Vec<LinuxUidMapping>>,
}

#[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<String>,

+ #[serde(rename = "idle")]
+ pub idle: Option<i64>,
+
#[serde(rename = "mems")]
pub mems: Option<String>,

@@ -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<Vec<MountGidMapping>>,
+
#[serde(rename = "options")]
pub options: Option<Vec<String>>,

@@ -614,6 +620,33 @@ pub struct Mount {

#[serde(rename = "type")]
pub mount_type: Option<String>,
+
+ #[serde(rename = "uidMappings")]
+ pub uid_mappings: Option<Vec<MountUidMapping>>,
+}
+
+#[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)]

8 changes: 4 additions & 4 deletions src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub struct Linux {
pub devices: Option<Vec<LinuxDevice>>,

#[serde(rename = "gidMappings")]
pub gid_mappings: Option<Vec<GidMapping>>,
pub gid_mappings: Option<Vec<LinuxGidMapping>>,

#[serde(rename = "intelRdt")]
pub intel_rdt: Option<IntelRdt>,
Expand Down Expand Up @@ -216,7 +216,7 @@ pub struct Linux {
pub sysctl: Option<HashMap<String, Option<serde_json::Value>>>,

#[serde(rename = "uidMappings")]
pub uid_mappings: Option<Vec<UidMapping>>,
pub uid_mappings: Option<Vec<LinuxUidMapping>>,
}

#[derive(Serialize, Deserialize)]
Expand Down Expand Up @@ -248,7 +248,7 @@ pub struct LinuxDevice {
}

#[derive(Serialize, Deserialize)]
pub struct GidMapping {
pub struct LinuxGidMapping {
#[serde(rename = "containerID")]
pub container_id: i64,

Expand Down Expand Up @@ -590,7 +590,7 @@ pub struct Arg {
}

#[derive(Serialize, Deserialize)]
pub struct UidMapping {
pub struct LinuxUidMapping {
#[serde(rename = "containerID")]
pub container_id: i64,

Expand Down

0 comments on commit b1b78a7

Please sign in to comment.