Kaydet (Commit) 8fd9d3c9 authored tarafından Joffrey F's avatar Joffrey F

GenericResources was introduced in 1.32

Signed-off-by: 's avatarJoffrey F <joffrey@docker.com>
üst f40079d8
......@@ -74,9 +74,9 @@ def _check_api_features(version, task_template, update_config, endpoint_spec):
raise_version_error('ContainerSpec.isolation', '1.35')
if task_template.get('Resources'):
if utils.version_lt(version, '1.35'):
if utils.version_lt(version, '1.32'):
if task_template['Resources'].get('GenericResources'):
raise_version_error('Resources.generic_resources', '1.35')
raise_version_error('Resources.generic_resources', '1.32')
def _merge_task_template(current, override):
......
......@@ -226,7 +226,7 @@ class ServiceTest(BaseAPIIntegrationTest):
svc_id = self.client.create_service(task_tmpl, name=name)
return resources, self.client.inspect_service(svc_id)
@requires_api_version('1.35')
@requires_api_version('1.32')
def test_create_service_with_generic_resources(self):
successful = [{
'input': [
......@@ -258,6 +258,7 @@ class ServiceTest(BaseAPIIntegrationTest):
expected = test.get('expected', test['input'])
assert sorted(actual, key=_key) == sorted(expected, key=_key)
@requires_api_version('1.32')
def test_create_service_with_invalid_generic_resources(self):
for test_input in ['1', 1.0, lambda: '1', {1, 2}]:
with pytest.raises(docker.errors.InvalidArgument):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment