Kaynağa Gözat

Correct some schema field definitions

Now validation is split in two, the integration tests helped
highlight some places where the schema definition was incorrect.

Signed-off-by: Mazz Mosley <[email protected]>
Mazz Mosley 10 yıl önce
ebeveyn
işleme
f51a5431ec
1 değiştirilmiş dosya ile 10 ekleme ve 5 silme
  1. 10 5
      compose/config/fields_schema.json

+ 10 - 5
compose/config/fields_schema.json

@@ -19,7 +19,12 @@
         "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
         "command": {"$ref": "#/definitions/string_or_list"},
         "container_name": {"type": "string"},
-        "cpu_shares": {"type": "string"},
+        "cpu_shares": {
+          "oneOf": [
+            {"type": "number"},
+            {"type": "string"}
+          ]
+        },
         "cpuset": {"type": "string"},
         "detach": {"type": "boolean"},
         "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
@@ -27,7 +32,7 @@
         "dns_search": {"$ref": "#/definitions/string_or_list"},
         "dockerfile": {"type": "string"},
         "domainname": {"type": "string"},
-        "entrypoint": {"type": "string"},
+        "entrypoint": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
         "env_file": {"$ref": "#/definitions/string_or_list"},
 
         "environment": {
@@ -75,7 +80,7 @@
         },
         "name": {"type": "string"},
         "net": {"type": "string"},
-        "pid": {"type": "string"},
+        "pid": {"type": ["string", "null"]},
 
         "ports": {
           "type": "array",
@@ -94,10 +99,10 @@
           "uniqueItems": true
         },
 
-        "privileged": {"type": "string"},
+        "privileged": {"type": "boolean"},
         "read_only": {"type": "boolean"},
         "restart": {"type": "string"},
-        "security_opt": {"type": "string"},
+        "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
         "stdin_open": {"type": "string"},
         "tty": {"type": "string"},
         "user": {"type": "string"},