Browse Source

Unify healthcheck spec definition in v2 and v3

Signed-off-by: Joffrey F <[email protected]>
Joffrey F 8 years ago
parent
commit
8145429399

+ 1 - 1
compose/config/config.py

@@ -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: '

+ 1 - 1
compose/config/config_schema_v2.1.json

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

+ 6 - 6
compose/config/config_schema_v3.0.json

@@ -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",

+ 1 - 1
tests/integration/project_test.py

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