mirror of https://github.com/docker/docker-py.git
Move volume_driver to RUN_HOST_CONFIG_KWARGS
Fixes #2271 Signed-off-by: Hannes Ljungberg <hannes@5monkeys.se>
This commit is contained in:
parent
142db4b3d3
commit
523371e21d
|
@ -964,7 +964,6 @@ RUN_CREATE_KWARGS = [
|
|||
'tty',
|
||||
'use_config_proxy',
|
||||
'user',
|
||||
'volume_driver',
|
||||
'working_dir',
|
||||
]
|
||||
|
||||
|
@ -1028,6 +1027,7 @@ RUN_HOST_CONFIG_KWARGS = [
|
|||
'userns_mode',
|
||||
'uts_mode',
|
||||
'version',
|
||||
'volume_driver',
|
||||
'volumes_from',
|
||||
'runtime'
|
||||
]
|
||||
|
|
|
@ -378,3 +378,13 @@ class ContainerTest(BaseIntegrationTest):
|
|||
detach=True)
|
||||
self.tmp_containers.append(container.id)
|
||||
assert container.wait()['StatusCode'] == 1
|
||||
|
||||
def test_create_with_volume_driver(self):
|
||||
client = docker.from_env(version=TEST_API_VERSION)
|
||||
container = client.containers.create(
|
||||
'alpine',
|
||||
'sleep 300',
|
||||
volume_driver='foo'
|
||||
)
|
||||
self.tmp_containers.append(container.id)
|
||||
assert container.attrs['HostConfig']['VolumeDriver'] == 'foo'
|
||||
|
|
|
@ -176,6 +176,7 @@ class ContainerCollectionTest(unittest.TestCase):
|
|||
'Ulimits': [{"Name": "nofile", "Soft": 1024, "Hard": 2048}],
|
||||
'UsernsMode': 'host',
|
||||
'UTSMode': 'host',
|
||||
'VolumeDriver': 'some_driver',
|
||||
'VolumesFrom': ['container'],
|
||||
},
|
||||
healthcheck={'test': 'true'},
|
||||
|
@ -190,7 +191,6 @@ class ContainerCollectionTest(unittest.TestCase):
|
|||
stop_signal=9,
|
||||
tty=True,
|
||||
user='bob',
|
||||
volume_driver='some_driver',
|
||||
volumes=[
|
||||
'/mnt/vol2',
|
||||
'/mnt/vol1',
|
||||
|
|
Loading…
Reference in New Issue