Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: add IDMapping for mountpoints and add idle type to CPU. #116

Merged
merged 3 commits into from
Aug 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 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 @@ -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>,

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

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

Expand All @@ -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>>,

Expand All @@ -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)]
Expand Down