forked from containers/libocispec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust,runtime: rename GidMapping,UidMapping to Linux{Uid/Gid}Mapping
Signed-off-by: Aditya R <arajan@redhat.com>
- Loading branch information
Showing
2 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters