mirror of https://github.com/docker/cli.git
cli/compose: allow depends_on advanced syntax
While stack does not support "depends_on", and will produce an warning when used, it's useful to allow it to _parse_ a compose-file that uses the advanced syntax. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
cfe18f5e03
commit
46be579991
|
@ -1,6 +1,12 @@
|
||||||
version: "3.12"
|
version: "3.12"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
bar:
|
||||||
|
image: busybox:latest
|
||||||
|
depends_on:
|
||||||
|
foo:
|
||||||
|
condition: service_started
|
||||||
|
required: true
|
||||||
foo:
|
foo:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
version: "3.12"
|
version: "3.12"
|
||||||
services:
|
services:
|
||||||
|
bar:
|
||||||
|
image: busybox:latest
|
||||||
|
depends_on:
|
||||||
|
foo:
|
||||||
|
condition: service_started
|
||||||
|
required: true
|
||||||
foo:
|
foo:
|
||||||
build:
|
build:
|
||||||
context: ./dir
|
context: ./dir
|
||||||
|
|
|
@ -133,7 +133,33 @@
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"depends_on": {"$ref": "#/definitions/list_of_strings"},
|
"depends_on": {
|
||||||
|
"oneOf": [
|
||||||
|
{"$ref": "#/definitions/list_of_strings"},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"patternProperties": {
|
||||||
|
"^[a-zA-Z0-9._-]+$": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"restart": {"type": "boolean"},
|
||||||
|
"required": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["service_started", "service_healthy", "service_completed_successfully"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["condition"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
"dns": {"$ref": "#/definitions/string_or_list"},
|
"dns": {"$ref": "#/definitions/string_or_list"},
|
||||||
"dns_search": {"$ref": "#/definitions/string_or_list"},
|
"dns_search": {"$ref": "#/definitions/string_or_list"},
|
||||||
|
|
Loading…
Reference in New Issue