mirror of
https://github.com/docker/compose.git
synced 2025-07-23 21:54:40 +02:00
Merge branch '4904-label-config-validation' of https://github.com/nginth/compose into nginth-4904-label-config-validation
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
commit
c387d05a40
@ -78,7 +78,7 @@
|
|||||||
"hostname": {"type": "string"},
|
"hostname": {"type": "string"},
|
||||||
"image": {"type": "string"},
|
"image": {"type": "string"},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
"log_driver": {"type": "string"},
|
"log_driver": {"type": "string"},
|
||||||
"log_opt": {"type": "object"},
|
"log_opt": {"type": "object"},
|
||||||
@ -166,6 +166,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"constraints": {
|
"constraints": {
|
||||||
"service": {
|
"service": {
|
||||||
"id": "#/definitions/constraints/service",
|
"id": "#/definitions/constraints/service",
|
||||||
|
@ -158,7 +158,7 @@
|
|||||||
"hostname": {"type": "string"},
|
"hostname": {"type": "string"},
|
||||||
"image": {"type": "string"},
|
"image": {"type": "string"},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -355,6 +355,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"blkio_limit": {
|
"blkio_limit": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
"context": {"type": "string"},
|
"context": {"type": "string"},
|
||||||
"dockerfile": {"type": "string"},
|
"dockerfile": {"type": "string"},
|
||||||
"args": {"$ref": "#/definitions/list_or_dict"},
|
"args": {"$ref": "#/definitions/list_or_dict"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@
|
|||||||
"image": {"type": "string"},
|
"image": {"type": "string"},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"isolation": {"type": "string"},
|
"isolation": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -351,7 +351,7 @@
|
|||||||
},
|
},
|
||||||
"internal": {"type": "boolean"},
|
"internal": {"type": "boolean"},
|
||||||
"enable_ipv6": {"type": "boolean"},
|
"enable_ipv6": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@ -375,7 +375,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@ -409,6 +409,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"blkio_limit": {
|
"blkio_limit": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
"context": {"type": "string"},
|
"context": {"type": "string"},
|
||||||
"dockerfile": {"type": "string"},
|
"dockerfile": {"type": "string"},
|
||||||
"args": {"$ref": "#/definitions/list_or_dict"},
|
"args": {"$ref": "#/definitions/list_or_dict"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"cache_from": {"$ref": "#/definitions/list_of_strings"},
|
"cache_from": {"$ref": "#/definitions/list_of_strings"},
|
||||||
"network": {"type": "string"}
|
"network": {"type": "string"}
|
||||||
},
|
},
|
||||||
@ -189,7 +189,7 @@
|
|||||||
"init": {"type": ["boolean", "string"]},
|
"init": {"type": ["boolean", "string"]},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"isolation": {"type": "string"},
|
"isolation": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -358,7 +358,7 @@
|
|||||||
},
|
},
|
||||||
"internal": {"type": "boolean"},
|
"internal": {"type": "boolean"},
|
||||||
"enable_ipv6": {"type": "boolean"},
|
"enable_ipv6": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@ -382,7 +382,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@ -416,6 +416,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"blkio_limit": {
|
"blkio_limit": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
"context": {"type": "string"},
|
"context": {"type": "string"},
|
||||||
"dockerfile": {"type": "string"},
|
"dockerfile": {"type": "string"},
|
||||||
"args": {"$ref": "#/definitions/list_or_dict"},
|
"args": {"$ref": "#/definitions/list_or_dict"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"cache_from": {"$ref": "#/definitions/list_of_strings"},
|
"cache_from": {"$ref": "#/definitions/list_of_strings"},
|
||||||
"network": {"type": "string"},
|
"network": {"type": "string"},
|
||||||
"target": {"type": "string"},
|
"target": {"type": "string"},
|
||||||
@ -192,7 +192,7 @@
|
|||||||
"init": {"type": ["boolean", "string"]},
|
"init": {"type": ["boolean", "string"]},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"isolation": {"type": "string"},
|
"isolation": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -395,7 +395,7 @@
|
|||||||
},
|
},
|
||||||
"internal": {"type": "boolean"},
|
"internal": {"type": "boolean"},
|
||||||
"enable_ipv6": {"type": "boolean"},
|
"enable_ipv6": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@ -419,7 +419,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@ -453,6 +453,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"blkio_limit": {
|
"blkio_limit": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
"hostname": {"type": "string"},
|
"hostname": {"type": "string"},
|
||||||
"image": {"type": "string"},
|
"image": {"type": "string"},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -223,7 +223,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"mode": {"type": "string"},
|
"mode": {"type": "string"},
|
||||||
"replicas": {"type": "integer"},
|
"replicas": {"type": "integer"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"update_config": {
|
"update_config": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -310,7 +310,7 @@
|
|||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"internal": {"type": "boolean"},
|
"internal": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -333,7 +333,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -366,6 +366,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"constraints": {
|
"constraints": {
|
||||||
"service": {
|
"service": {
|
||||||
"id": "#/definitions/constraints/service",
|
"id": "#/definitions/constraints/service",
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
"hostname": {"type": "string"},
|
"hostname": {"type": "string"},
|
||||||
"image": {"type": "string"},
|
"image": {"type": "string"},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -252,7 +252,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"mode": {"type": "string"},
|
"mode": {"type": "string"},
|
||||||
"replicas": {"type": "integer"},
|
"replicas": {"type": "integer"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"update_config": {
|
"update_config": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -339,7 +339,7 @@
|
|||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"internal": {"type": "boolean"},
|
"internal": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -362,7 +362,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -378,7 +378,7 @@
|
|||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -411,6 +411,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"constraints": {
|
"constraints": {
|
||||||
"service": {
|
"service": {
|
||||||
"id": "#/definitions/constraints/service",
|
"id": "#/definitions/constraints/service",
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
"hostname": {"type": "string"},
|
"hostname": {"type": "string"},
|
||||||
"image": {"type": "string"},
|
"image": {"type": "string"},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -299,7 +299,7 @@
|
|||||||
"mode": {"type": "string"},
|
"mode": {"type": "string"},
|
||||||
"endpoint_mode": {"type": "string"},
|
"endpoint_mode": {"type": "string"},
|
||||||
"replicas": {"type": "integer"},
|
"replicas": {"type": "integer"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"update_config": {
|
"update_config": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -387,7 +387,7 @@
|
|||||||
},
|
},
|
||||||
"internal": {"type": "boolean"},
|
"internal": {"type": "boolean"},
|
||||||
"attachable": {"type": "boolean"},
|
"attachable": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -410,7 +410,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -426,7 +426,7 @@
|
|||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -459,6 +459,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"constraints": {
|
"constraints": {
|
||||||
"service": {
|
"service": {
|
||||||
"id": "#/definitions/constraints/service",
|
"id": "#/definitions/constraints/service",
|
||||||
|
@ -83,7 +83,7 @@
|
|||||||
"context": {"type": "string"},
|
"context": {"type": "string"},
|
||||||
"dockerfile": {"type": "string"},
|
"dockerfile": {"type": "string"},
|
||||||
"args": {"$ref": "#/definitions/list_or_dict"},
|
"args": {"$ref": "#/definitions/list_or_dict"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"cache_from": {"$ref": "#/definitions/list_of_strings"}
|
"cache_from": {"$ref": "#/definitions/list_of_strings"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@ -151,7 +151,7 @@
|
|||||||
"hostname": {"type": "string"},
|
"hostname": {"type": "string"},
|
||||||
"image": {"type": "string"},
|
"image": {"type": "string"},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -332,7 +332,7 @@
|
|||||||
"mode": {"type": "string"},
|
"mode": {"type": "string"},
|
||||||
"endpoint_mode": {"type": "string"},
|
"endpoint_mode": {"type": "string"},
|
||||||
"replicas": {"type": "integer"},
|
"replicas": {"type": "integer"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"update_config": {
|
"update_config": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -430,7 +430,7 @@
|
|||||||
},
|
},
|
||||||
"internal": {"type": "boolean"},
|
"internal": {"type": "boolean"},
|
||||||
"attachable": {"type": "boolean"},
|
"attachable": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -453,7 +453,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -469,7 +469,7 @@
|
|||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -485,7 +485,7 @@
|
|||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -518,6 +518,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"constraints": {
|
"constraints": {
|
||||||
"service": {
|
"service": {
|
||||||
"id": "#/definitions/constraints/service",
|
"id": "#/definitions/constraints/service",
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
"context": {"type": "string"},
|
"context": {"type": "string"},
|
||||||
"dockerfile": {"type": "string"},
|
"dockerfile": {"type": "string"},
|
||||||
"args": {"$ref": "#/definitions/list_or_dict"},
|
"args": {"$ref": "#/definitions/list_or_dict"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"cache_from": {"$ref": "#/definitions/list_of_strings"},
|
"cache_from": {"$ref": "#/definitions/list_of_strings"},
|
||||||
"network": {"type": "string"},
|
"network": {"type": "string"},
|
||||||
"target": {"type": "string"}
|
"target": {"type": "string"}
|
||||||
@ -155,7 +155,7 @@
|
|||||||
"hostname": {"type": "string"},
|
"hostname": {"type": "string"},
|
||||||
"image": {"type": "string"},
|
"image": {"type": "string"},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -337,7 +337,7 @@
|
|||||||
"mode": {"type": "string"},
|
"mode": {"type": "string"},
|
||||||
"endpoint_mode": {"type": "string"},
|
"endpoint_mode": {"type": "string"},
|
||||||
"replicas": {"type": "integer"},
|
"replicas": {"type": "integer"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"update_config": {
|
"update_config": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -438,7 +438,7 @@
|
|||||||
},
|
},
|
||||||
"internal": {"type": "boolean"},
|
"internal": {"type": "boolean"},
|
||||||
"attachable": {"type": "boolean"},
|
"attachable": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -462,7 +462,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -478,7 +478,7 @@
|
|||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -494,7 +494,7 @@
|
|||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -527,6 +527,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"constraints": {
|
"constraints": {
|
||||||
"service": {
|
"service": {
|
||||||
"id": "#/definitions/constraints/service",
|
"id": "#/definitions/constraints/service",
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
"context": {"type": "string"},
|
"context": {"type": "string"},
|
||||||
"dockerfile": {"type": "string"},
|
"dockerfile": {"type": "string"},
|
||||||
"args": {"$ref": "#/definitions/list_or_dict"},
|
"args": {"$ref": "#/definitions/list_or_dict"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"cache_from": {"$ref": "#/definitions/list_of_strings"},
|
"cache_from": {"$ref": "#/definitions/list_of_strings"},
|
||||||
"network": {"type": "string"},
|
"network": {"type": "string"},
|
||||||
"target": {"type": "string"},
|
"target": {"type": "string"},
|
||||||
@ -156,7 +156,7 @@
|
|||||||
"image": {"type": "string"},
|
"image": {"type": "string"},
|
||||||
"ipc": {"type": "string"},
|
"ipc": {"type": "string"},
|
||||||
"isolation": {"type": "string"},
|
"isolation": {"type": "string"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
|
|
||||||
"logging": {
|
"logging": {
|
||||||
@ -338,7 +338,7 @@
|
|||||||
"mode": {"type": "string"},
|
"mode": {"type": "string"},
|
||||||
"endpoint_mode": {"type": "string"},
|
"endpoint_mode": {"type": "string"},
|
||||||
"replicas": {"type": "integer"},
|
"replicas": {"type": "integer"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"},
|
"labels": {"$ref": "#/definitions/labels"},
|
||||||
"update_config": {
|
"update_config": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -464,7 +464,7 @@
|
|||||||
},
|
},
|
||||||
"internal": {"type": "boolean"},
|
"internal": {"type": "boolean"},
|
||||||
"attachable": {"type": "boolean"},
|
"attachable": {"type": "boolean"},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -488,7 +488,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -505,7 +505,7 @@
|
|||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -522,7 +522,7 @@
|
|||||||
"name": {"type": "string"}
|
"name": {"type": "string"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
"labels": {"$ref": "#/definitions/labels"}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
@ -555,6 +555,21 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"labels": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
".+": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"constraints": {
|
"constraints": {
|
||||||
"service": {
|
"service": {
|
||||||
"id": "#/definitions/constraints/service",
|
"id": "#/definitions/constraints/service",
|
||||||
|
@ -2747,6 +2747,25 @@ class ConfigTest(unittest.TestCase):
|
|||||||
]
|
]
|
||||||
assert service_sort(service_dicts) == service_sort(expected)
|
assert service_sort(service_dicts) == service_sort(expected)
|
||||||
|
|
||||||
|
def test_config_invalid_service_label_validation(self):
|
||||||
|
config_details = build_config_details(
|
||||||
|
{
|
||||||
|
'version': '3.5',
|
||||||
|
'services': {
|
||||||
|
'web': {
|
||||||
|
'image': 'busybox',
|
||||||
|
'labels': {
|
||||||
|
"key": 12345
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
with pytest.raises(ConfigurationError) as exc:
|
||||||
|
config.load(config_details)
|
||||||
|
|
||||||
|
assert "which is an invalid type, it should be a string" in exc.exconly()
|
||||||
|
|
||||||
def test_service_volume_invalid_config(self):
|
def test_service_volume_invalid_config(self):
|
||||||
config_details = build_config_details(
|
config_details = build_config_details(
|
||||||
{
|
{
|
||||||
@ -2766,14 +2785,31 @@ class ConfigTest(unittest.TestCase):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
with pytest.raises(ConfigurationError) as exc:
|
with pytest.raises(ConfigurationError) as exc:
|
||||||
config.load(config_details)
|
config.load(config_details)
|
||||||
|
|
||||||
assert "services.web.volumes contains unsupported option: 'garbage'" in exc.exconly()
|
assert "services.web.volumes contains unsupported option: 'garbage'" in exc.exconly()
|
||||||
|
|
||||||
|
def test_config_valid_service_label_validation(self):
|
||||||
|
config_details = build_config_details(
|
||||||
|
{
|
||||||
|
'version': '3.5',
|
||||||
|
'services': {
|
||||||
|
'web': {
|
||||||
|
'image': 'busybox',
|
||||||
|
'labels': {
|
||||||
|
"key": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
config.load(config_details)
|
||||||
|
|
||||||
|
|
||||||
class NetworkModeTest(unittest.TestCase):
|
class NetworkModeTest(unittest.TestCase):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user