summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloud/docker/docker.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/cloud/docker/docker.py b/cloud/docker/docker.py
index 2d6e669d..c7f90c2c 100644
--- a/cloud/docker/docker.py
+++ b/cloud/docker/docker.py
@@ -892,6 +892,9 @@ class DockerManager(object):
running = self.get_running_containers()
current = self.get_inspect_containers(running)
+ #Get API version
+ api_version = self.client.version()['ApiVersion']
+
image = self.get_inspect_image()
if image is None:
# The image isn't present. Assume that we're about to pull a new
@@ -956,6 +959,10 @@ class DockerManager(object):
expected_mem = _human_to_bytes(self.module.params.get('memory_limit'))
actual_mem = container['HostConfig']['Memory']
+ #Use v1.18 API and earlier Memory element location
+ if docker_api_version <= 1.18:
+ actual_mem = container['Config']['Memory']
+
if expected_mem and actual_mem != expected_mem:
self.reload_reasons.append('memory ({0} => {1})'.format(actual_mem, expected_mem))
differing.append(container)