Skip to content

Commit 300b0ed

Browse files
jhrotkondeloof
authored andcommitted
add x- extensions to depends_on
Signed-off-by: Joana Hrotko <[email protected]>
1 parent 6ae23e7 commit 300b0ed

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

loader/loader_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ configs:
314314
external: true
315315
x-config-ext: config
316316
services:
317+
another:
318+
image: busybox
319+
depends_on:
320+
foo:
321+
condition: service_started
322+
x-depends-on: depends
317323
foo:
318324
image: busybox
319325
x-foo: bar
@@ -325,7 +331,7 @@ services:
325331
assert.Check(t, is.DeepEqual(types.Extensions{
326332
"x-project": "project",
327333
}, actual.Extensions))
328-
assert.Check(t, is.Len(actual.Services, 1))
334+
assert.Check(t, is.Len(actual.Services, 2))
329335
service := actual.Services["foo"]
330336
assert.Check(t, is.Equal("busybox", service.Image))
331337

@@ -341,6 +347,11 @@ services:
341347
assert.Check(t, is.DeepEqual(types.Extensions{
342348
"x-healthcheck": "health",
343349
}, service.HealthCheck.Extensions))
350+
351+
another := actual.Services["another"]
352+
assert.Check(t, is.DeepEqual(types.Extensions{
353+
"x-depends-on": "depends",
354+
}, another.DependsOn["foo"].Extensions))
344355
}
345356

346357
func TestLoadExtends(t *testing.T) {

schema/compose-spec.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
"^[a-zA-Z0-9._-]+$": {
198198
"type": "object",
199199
"additionalProperties": false,
200+
"patternProperties": {"^x-": {}},
200201
"properties": {
201202
"restart": {"type": ["boolean", "string"]},
202203
"required": {

0 commit comments

Comments
 (0)