mirror of https://github.com/docker/compose.git
Unify healthcheck spec definition in v2 and v3
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
be88bb0e6c
commit
8145429399
|
@ -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: '
|
||||||
|
|
|
@ -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": {
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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': {
|
||||||
|
|
Loading…
Reference in New Issue