Skip to content

Commit

Permalink
Merged PR 930111: Fix docker model struct for container inspect response
Browse files Browse the repository at this point in the history
Fix docker model struct for container inspect response

The issue is that iotedged throws a deserialization error when we exec attach a terminal to a container. The bug is in the docker swagger YAML which is wrong. This fixes the discrepancy.
  • Loading branch information
avranju committed Jun 28, 2018
1 parent 12bdbab commit 31468a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions edgelet/docker-rs/src/models/inline_response_200.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct InlineResponse200 {
#[serde(rename = "AppArmorProfile", skip_serializing_if = "Option::is_none")]
app_armor_profile: Option<String>,
#[serde(rename = "ExecIDs", skip_serializing_if = "Option::is_none")]
exec_i_ds: Option<String>,
exec_i_ds: Option<Vec<String>>,
#[serde(rename = "HostConfig", skip_serializing_if = "Option::is_none")]
host_config: Option<::models::HostConfig>,
#[serde(rename = "GraphDriver", skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -393,16 +393,16 @@ impl InlineResponse200 {
self.app_armor_profile = None;
}

pub fn set_exec_i_ds(&mut self, exec_i_ds: String) {
pub fn set_exec_i_ds(&mut self, exec_i_ds: Vec<String>) {
self.exec_i_ds = Some(exec_i_ds);
}

pub fn with_exec_i_ds(mut self, exec_i_ds: String) -> InlineResponse200 {
pub fn with_exec_i_ds(mut self, exec_i_ds: Vec<String>) -> InlineResponse200 {
self.exec_i_ds = Some(exec_i_ds);
self
}

pub fn exec_i_ds(&self) -> Option<&String> {
pub fn exec_i_ds(&self) -> Option<&Vec<String>> {
self.exec_i_ds.as_ref()
}

Expand Down
3 changes: 2 additions & 1 deletion edgelet/edgelet-docker/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ mod tests {
.with_finished_at(finished_at.clone())
.with_pid(1234),
)
.with_id("mod1".to_string()),
.with_id("mod1".to_string())
.with_exec_i_ds(vec!["id1".to_string(), "id2".to_string()]),
),
"mod1",
DockerConfig::new("ubuntu", ContainerCreateBody::new(), None).unwrap(),
Expand Down

0 comments on commit 31468a1

Please sign in to comment.