mirror of https://github.com/docker/docker-py.git
Merge branch 'master' of github.com:docker/docker-py
This commit is contained in:
commit
fe2e120705
|
@ -38,7 +38,7 @@ def _check_api_features(version, task_template, update_config):
|
|||
'Placement.preferences is not supported in'
|
||||
' API version < 1.27'
|
||||
)
|
||||
if task_template.container_spec.get('TTY'):
|
||||
if task_template.get('ContainerSpec', {}).get('TTY'):
|
||||
if utils.version_lt(version, '1.25'):
|
||||
raise errors.InvalidVersion(
|
||||
'ContainerSpec.TTY is not supported in API version < 1.25'
|
||||
|
|
|
@ -224,7 +224,7 @@ class ImageCollection(Collection):
|
|||
If the server returns an error.
|
||||
"""
|
||||
resp = self.client.api.images(name=name, all=all, filters=filters)
|
||||
return [self.prepare_model(r) for r in resp]
|
||||
return [self.get(r["Id"]) for r in resp]
|
||||
|
||||
def load(self, data):
|
||||
"""
|
||||
|
|
|
@ -376,6 +376,23 @@ class ServiceTest(BaseAPIIntegrationTest):
|
|||
assert 'TTY' in con_spec
|
||||
assert con_spec['TTY'] is True
|
||||
|
||||
@requires_api_version('1.25')
|
||||
def test_create_service_with_tty_dict(self):
|
||||
container_spec = {
|
||||
'Image': BUSYBOX,
|
||||
'Command': ['true'],
|
||||
'TTY': True
|
||||
}
|
||||
task_tmpl = docker.types.TaskTemplate(container_spec)
|
||||
name = self.get_service_name()
|
||||
svc_id = self.client.create_service(task_tmpl, name=name)
|
||||
svc_info = self.client.inspect_service(svc_id)
|
||||
assert 'TaskTemplate' in svc_info['Spec']
|
||||
assert 'ContainerSpec' in svc_info['Spec']['TaskTemplate']
|
||||
con_spec = svc_info['Spec']['TaskTemplate']['ContainerSpec']
|
||||
assert 'TTY' in con_spec
|
||||
assert con_spec['TTY'] is True
|
||||
|
||||
def test_create_service_global_mode(self):
|
||||
container_spec = docker.types.ContainerSpec(
|
||||
BUSYBOX, ['echo', 'hello']
|
||||
|
|
Loading…
Reference in New Issue