Merge pull request #4291 from shin-/unify-healthcheck-def-v2v3

Unify healthcheck spec definition in v2 and v3
This commit is contained in:
Joffrey F 2017-01-04 13:53:39 -08:00 committed by GitHub
commit 838bdd71f3
4 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

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

View File

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