Skip to content

Commit 7417bc2

Browse files
committed
Don't support tmpfs in API version < 1.22
Signed-off-by: Aanand Prasad <[email protected]>
1 parent 4ffa1be commit 7417bc2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docker/utils/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,8 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
781781
host_config['CpuPeriod'] = cpu_period
782782

783783
if tmpfs:
784+
if version_lt(version, '1.22'):
785+
raise host_config_version_error('tmpfs', '1.22')
784786
host_config["Tmpfs"] = convert_tmpfs_mounts(tmpfs)
785787

786788
return host_config

tests/unit/container_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@ def test_create_container_with_aliases(self):
10161016
}
10171017
}}'''))
10181018

1019+
@requires_api_version('1.22')
10191020
def test_create_container_with_tmpfs_list(self):
10201021

10211022
self.client.create_container(
@@ -1044,6 +1045,7 @@ def test_create_container_with_tmpfs_list(self):
10441045
DEFAULT_TIMEOUT_SECONDS
10451046
)
10461047

1048+
@requires_api_version('1.22')
10471049
def test_create_container_with_tmpfs_dict(self):
10481050

10491051
self.client.create_container(

0 commit comments

Comments
 (0)