Compare commits

...

2 Commits

Author SHA1 Message Date
Sebastiaan van Stijn be0fce867d
Merge 46be579991 into a93fb1678a 2024-11-21 11:27:45 +01:00
Sebastiaan van Stijn 46be579991
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>
2024-01-08 18:11:49 +01:00
3 changed files with 39 additions and 1 deletions

View File

@ -1,6 +1,12 @@
version: "3.13"
services:
bar:
image: busybox:latest
depends_on:
foo:
condition: service_started
required: true
foo:
build:

View File

@ -1,5 +1,11 @@
version: "3.13"
services:
bar:
image: busybox:latest
depends_on:
foo:
condition: service_started
required: true
foo:
build:
context: ./dir

View File

@ -133,7 +133,33 @@
},
"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},
"dns": {"$ref": "#/definitions/string_or_list"},
"dns_search": {"$ref": "#/definitions/string_or_list"},