summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhuri Kumari <madhuri.rai07@gmail.com>2017-06-01 16:53:58 +0000
committerMadhuri Kumari <madhuri.kumari@intel.com>2017-06-07 10:47:27 +0530
commit612c0f3d0de298884b80766d285f8ad47ad742a0 (patch)
tree91a4a3af58cdb307eddfb9b466a40f460bbfd8d5
parent6ae24b9e60cd8f080a6c657ccbdffd22056169dd (diff)
downloaddocker-py-612c0f3d0de298884b80766d285f8ad47ad742a0.tar.gz
Fix test cases for ``runtime`` config
Signed-off-by: Madhuri Kumari <madhuri.kumari@intel.com>
-rw-r--r--docker/api/container.py4
-rw-r--r--docker/models/containers.py2
-rw-r--r--docker/types/containers.py2
-rw-r--r--docs/change-log.md2
-rw-r--r--tests/integration/api_container_test.py6
5 files changed, 8 insertions, 8 deletions
diff --git a/docker/api/container.py b/docker/api/container.py
index 0abfca4..2352df9 100644
--- a/docker/api/container.py
+++ b/docker/api/container.py
@@ -417,7 +417,7 @@ class ContainerApiMixin(object):
Default: 10
networking_config (dict): A networking configuration generated
by :py:meth:`create_networking_config`.
- runtime (str): The name of the runtime tool to create container.
+ runtime (str): Runtime to use with this container.
Returns:
A dictionary with an image 'Id' key and a 'Warnings' key.
@@ -577,7 +577,7 @@ class ContainerApiMixin(object):
values are: ``host``
volumes_from (:py:class:`list`): List of container names or IDs to
get volumes from.
- runtime (str): The name of the runtime tool to manage container.
+ runtime (str): Runtime to use with this container.
Returns:
diff --git a/docker/models/containers.py b/docker/models/containers.py
index 46f900e..300c5a9 100644
--- a/docker/models/containers.py
+++ b/docker/models/containers.py
@@ -659,7 +659,7 @@ class ContainerCollection(Collection):
volumes_from (:py:class:`list`): List of container names or IDs to
get volumes from.
working_dir (str): Path to the working directory.
- runtime (str): The name of the runtime tool to create container.
+ runtime (str): Runtime to use with this container.
Returns:
The container logs, either ``STDOUT``, ``STDERR``, or both,
diff --git a/docker/types/containers.py b/docker/types/containers.py
index f834c78..6bbb57a 100644
--- a/docker/types/containers.py
+++ b/docker/types/containers.py
@@ -474,6 +474,8 @@ class HostConfig(dict):
self['NanoCpus'] = nano_cpus
if runtime:
+ if version_lt(version, '1.25'):
+ raise host_config_version_error('runtime', '1.25')
self['Runtime'] = runtime
diff --git a/docs/change-log.md b/docs/change-log.md
index 20bf9e0..3d58f93 100644
--- a/docs/change-log.md
+++ b/docs/change-log.md
@@ -122,8 +122,6 @@ Change log
* Added support for `force_update` in `TaskTemplate`
* Made `name` parameter optional in `APIClient.create_volume` and
`DockerClient.volumes.create`
-* Added support for `runtime` in `APIClient.create_container` and
- `DockerClient.containers.run`
### Bugfixes
diff --git a/tests/integration/api_container_test.py b/tests/integration/api_container_test.py
index c499e35..de3fe71 100644
--- a/tests/integration/api_container_test.py
+++ b/tests/integration/api_container_test.py
@@ -1255,14 +1255,14 @@ class ContainerCPUTest(BaseAPIIntegrationTest):
inspect_data = self.client.inspect_container(container)
self.assertEqual(inspect_data['HostConfig']['CpusetCpus'], cpuset_cpus)
-
- def test_create_with_runtime(self):
+ @requires_api_version('1.25')
+ def test_create_with_runtime(self):
container = self.client.create_container(
BUSYBOX, ['echo', 'test'], runtime='runc'
)
self.tmp_containers.append(container['Id'])
config = self.client.inspect_container(container)
- assert config['Config']['Runtime'] == 'runc'
+ assert config['HostConfig']['Runtime'] == 'runc'
class LinkTest(BaseAPIIntegrationTest):