Skip to content

Commit 612c0f3

Browse files
committed
Fix test cases for runtime config
Signed-off-by: Madhuri Kumari <madhuri.kumari@intel.com>
1 parent 6ae24b9 commit 612c0f3

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

docker/api/container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def create_container(self, image, command=None, hostname=None, user=None,
417417
Default: 10
418418
networking_config (dict): A networking configuration generated
419419
by :py:meth:`create_networking_config`.
420-
runtime (str): The name of the runtime tool to create container.
420+
runtime (str): Runtime to use with this container.
421421
422422
Returns:
423423
A dictionary with an image 'Id' key and a 'Warnings' key.
@@ -577,7 +577,7 @@ def create_host_config(self, *args, **kwargs):
577577
values are: ``host``
578578
volumes_from (:py:class:`list`): List of container names or IDs to
579579
get volumes from.
580-
runtime (str): The name of the runtime tool to manage container.
580+
runtime (str): Runtime to use with this container.
581581
582582
583583
Returns:

docker/models/containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ def run(self, image, command=None, stdout=True, stderr=False,
659659
volumes_from (:py:class:`list`): List of container names or IDs to
660660
get volumes from.
661661
working_dir (str): Path to the working directory.
662-
runtime (str): The name of the runtime tool to create container.
662+
runtime (str): Runtime to use with this container.
663663
664664
Returns:
665665
The container logs, either ``STDOUT``, ``STDERR``, or both,

docker/types/containers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ def __init__(self, version, binds=None, port_bindings=None,
474474
self['NanoCpus'] = nano_cpus
475475

476476
if runtime:
477+
if version_lt(version, '1.25'):
478+
raise host_config_version_error('runtime', '1.25')
477479
self['Runtime'] = runtime
478480

479481

docs/change-log.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ Change log
122122
* Added support for `force_update` in `TaskTemplate`
123123
* Made `name` parameter optional in `APIClient.create_volume` and
124124
`DockerClient.volumes.create`
125-
* Added support for `runtime` in `APIClient.create_container` and
126-
`DockerClient.containers.run`
127125

128126
### Bugfixes
129127

tests/integration/api_container_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,14 +1255,14 @@ def test_container_cpuset(self):
12551255
inspect_data = self.client.inspect_container(container)
12561256
self.assertEqual(inspect_data['HostConfig']['CpusetCpus'], cpuset_cpus)
12571257

1258-
1259-
def test_create_with_runtime(self):
1258+
@requires_api_version('1.25')
1259+
def test_create_with_runtime(self):
12601260
container = self.client.create_container(
12611261
BUSYBOX, ['echo', 'test'], runtime='runc'
12621262
)
12631263
self.tmp_containers.append(container['Id'])
12641264
config = self.client.inspect_container(container)
1265-
assert config['Config']['Runtime'] == 'runc'
1265+
assert config['HostConfig']['Runtime'] == 'runc'
12661266

12671267

12681268
class LinkTest(BaseAPIIntegrationTest):

0 commit comments

Comments
 (0)