From 0a1a47f3fb58a16716d58c2cd5372f0a228f7754 Mon Sep 17 00:00:00 2001 From: dsajanice Date: Wed, 22 Aug 2018 15:54:57 -0700 Subject: [PATCH] Fix container create model for volume mount (#187) * Fix container create model bug that is preventing volume mount * cleanup * cleanup * Use hashmap * Address review comment * style --- edgelet/docker-rs/src/models/container_create_body.rs | 8 ++++---- edgelet/edgelet-docker/tests/runtime.rs | 10 +++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/edgelet/docker-rs/src/models/container_create_body.rs b/edgelet/docker-rs/src/models/container_create_body.rs index 967bf7f4663..daac5467380 100644 --- a/edgelet/docker-rs/src/models/container_create_body.rs +++ b/edgelet/docker-rs/src/models/container_create_body.rs @@ -58,7 +58,7 @@ pub struct ContainerCreateBody { #[serde(rename = "Image", skip_serializing_if = "Option::is_none")] image: Option, #[serde(rename = "Volumes", skip_serializing_if = "Option::is_none")] - volumes: Option<::models::ContainerConfigVolumes>, + volumes: Option<::std::collections::HashMap>, /// The working directory for commands to run in. #[serde(rename = "WorkingDir", skip_serializing_if = "Option::is_none")] working_dir: Option, @@ -386,19 +386,19 @@ impl ContainerCreateBody { self.image = None; } - pub fn set_volumes(&mut self, volumes: ::models::ContainerConfigVolumes) { + pub fn set_volumes(&mut self, volumes: ::std::collections::HashMap) { self.volumes = Some(volumes); } pub fn with_volumes( mut self, - volumes: ::models::ContainerConfigVolumes, + volumes: ::std::collections::HashMap, ) -> ContainerCreateBody { self.volumes = Some(volumes); self } - pub fn volumes(&self) -> Option<&::models::ContainerConfigVolumes> { + pub fn volumes(&self) -> Option<&::std::collections::HashMap> { self.volumes.as_ref() } diff --git a/edgelet/edgelet-docker/tests/runtime.rs b/edgelet/edgelet-docker/tests/runtime.rs index 097a9176f9f..846c28e4f2c 100644 --- a/edgelet/edgelet-docker/tests/runtime.rs +++ b/edgelet/edgelet-docker/tests/runtime.rs @@ -288,6 +288,11 @@ fn container_create_handler(req: Request) -> Box