Unify healthcheck spec definition in v2 and v3

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2017-01-04 13:14:23 -08:00
parent be88bb0e6c
commit 8145429399
4 changed files with 9 additions and 9 deletions

View File

@ -675,7 +675,7 @@ def process_healthcheck(service_dict, service_name):
hc = {} hc = {}
raw = service_dict['healthcheck'] raw = service_dict['healthcheck']
if raw.get('disable') or raw.get('disabled'): if raw.get('disable'):
if len(raw) > 1: if len(raw) > 1:
raise ConfigurationError( raise ConfigurationError(
'Service "{}" defines an invalid healthcheck: ' 'Service "{}" defines an invalid healthcheck: '

View File

@ -258,7 +258,7 @@
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"disabled": {"type": "boolean"}, "disable": {"type": "boolean"},
"interval": {"type": "string"}, "interval": {"type": "string"},
"retries": {"type": "number"}, "retries": {"type": "number"},
"test": { "test": {

View File

@ -202,10 +202,11 @@
"healthcheck": { "healthcheck": {
"id": "#/definitions/healthcheck", "id": "#/definitions/healthcheck",
"type": ["object", "null"], "type": "object",
"additionalProperties": false,
"properties": { "properties": {
"interval": {"type":"string"}, "disable": {"type": "boolean"},
"timeout": {"type":"string"}, "interval": {"type": "string"},
"retries": {"type": "number"}, "retries": {"type": "number"},
"test": { "test": {
"oneOf": [ "oneOf": [
@ -213,9 +214,8 @@
{"type": "array", "items": {"type": "string"}} {"type": "array", "items": {"type": "string"}}
] ]
}, },
"disable": {"type": "boolean"} "timeout": {"type": "string"}
}, }
"additionalProperties": false
}, },
"deployment": { "deployment": {
"id": "#/definitions/deployment", "id": "#/definitions/deployment",

View File

@ -1463,7 +1463,7 @@ class ProjectTest(DockerClientTestCase):
'image': 'busybox:latest', 'image': 'busybox:latest',
'command': 'top', 'command': 'top',
'healthcheck': { 'healthcheck': {
'disabled': True 'disable': True
}, },
}, },
'svc2': { 'svc2': {