Add dns_opt to 2.1 schema

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2017-03-03 15:40:10 -08:00
parent c7b8278e78
commit 7512dccaa8
4 changed files with 20 additions and 12 deletions

View File

@ -80,7 +80,6 @@
"depends_on": {"$ref": "#/definitions/list_of_strings"}, "depends_on": {"$ref": "#/definitions/list_of_strings"},
"devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
"dns": {"$ref": "#/definitions/string_or_list"}, "dns": {"$ref": "#/definitions/string_or_list"},
"dns_search": {"$ref": "#/definitions/string_or_list"},
"dns_opt": { "dns_opt": {
"type": "array", "type": "array",
"items": { "items": {
@ -88,6 +87,7 @@
}, },
"uniqueItems": true "uniqueItems": true
}, },
"dns_search": {"$ref": "#/definitions/string_or_list"},
"domainname": {"type": "string"}, "domainname": {"type": "string"},
"entrypoint": { "entrypoint": {
"oneOf": [ "oneOf": [

View File

@ -100,6 +100,13 @@
] ]
}, },
"devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
"dns_opt": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"dns": {"$ref": "#/definitions/string_or_list"}, "dns": {"$ref": "#/definitions/string_or_list"},
"dns_search": {"$ref": "#/definitions/string_or_list"}, "dns_search": {"$ref": "#/definitions/string_or_list"},
"domainname": {"type": "string"}, "domainname": {"type": "string"},

View File

@ -757,6 +757,7 @@ class Service(object):
devices=options.get('devices'), devices=options.get('devices'),
dns=options.get('dns'), dns=options.get('dns'),
dns_opt=options.get('dns_opt'), dns_opt=options.get('dns_opt'),
dns_search=options.get('dns_search'),
restart_policy=options.get('restart'), restart_policy=options.get('restart'),
cap_add=options.get('cap_add'), cap_add=options.get('cap_add'),
cap_drop=options.get('cap_drop'), cap_drop=options.get('cap_drop'),

View File

@ -887,16 +887,16 @@ class ServiceTest(DockerClientTestCase):
container = create_and_start_container(service) container = create_and_start_container(service)
host_container_groupadd = container.get('HostConfig.GroupAdd') host_container_groupadd = container.get('HostConfig.GroupAdd')
self.assertTrue("root" in host_container_groupadd) assert "root" in host_container_groupadd
self.assertTrue("1" in host_container_groupadd) assert "1" in host_container_groupadd
def test_dns_opt_value(self): def test_dns_opt_value(self):
service = self.create_service('web', dns_opt=["use-vc", "no-tld-query"]) service = self.create_service('web', dns_opt=["use-vc", "no-tld-query"])
container = create_and_start_container(service) container = create_and_start_container(service)
dns_opt = container.get('HostConfig.DNSOptions') dns_opt = container.get('HostConfig.DnsOptions')
self.assertTrue("use-vc" in dns_opt) assert 'use-vc' in dns_opt
self.assertTrue("no-tld-query" in dns_opt) assert 'no-tld-query' in dns_opt
def test_restart_on_failure_value(self): def test_restart_on_failure_value(self):
service = self.create_service('web', restart={ service = self.create_service('web', restart={