Add storage_opt in v2.1

Signed-off-by: dinesh <dineshpy07@gmail.com>
This commit is contained in:
dinesh 2017-03-28 18:25:27 +05:30 committed by Joffrey F
parent 1dfdbe6f94
commit 6a957294df
3 changed files with 10 additions and 0 deletions

View File

@ -229,6 +229,7 @@
"stdin_open": {"type": "boolean"},
"stop_grace_period": {"type": "string", "format": "duration"},
"stop_signal": {"type": "string"},
"storage_opt": {"type": "object"},
"tmpfs": {"$ref": "#/definitions/string_or_list"},
"tty": {"type": "boolean"},
"ulimits": {

View File

@ -82,6 +82,7 @@ HOST_CONFIG_KEYS = [
'restart',
'security_opt',
'shm_size',
'storage_opt',
'sysctls',
'userns_mode',
'volumes_from',
@ -854,6 +855,7 @@ class Service(object):
volume_driver=options.get('volume_driver'),
cpuset_cpus=options.get('cpuset'),
cpu_shares=options.get('cpu_shares'),
storage_opt=options.get('storage_opt')
)
def get_secret_volumes(self):

View File

@ -208,6 +208,13 @@ class ServiceTest(DockerClientTestCase):
service.start_container(container)
self.assertEqual(set(container.get('HostConfig.SecurityOpt')), set(security_opt))
def test_create_container_with_storage_opt(self):
storage_opt = {'size': '1G'}
service = self.create_service('db', storage_opt=storage_opt)
container = service.create_container()
service.start_container(container)
self.assertEqual(container.get('HostConfig.StorageOpt'), storage_opt)
def test_create_container_with_mac_address(self):
service = self.create_service('db', mac_address='02:42:ac:11:65:43')
container = service.create_container()