Skip to content

Commit

Permalink
add x- extensions to depends_on
Browse files Browse the repository at this point in the history
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
  • Loading branch information
jhrotko authored and ndeloof committed Jul 9, 2024
1 parent 6ae23e7 commit 300b0ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ configs:
external: true
x-config-ext: config
services:
another:
image: busybox
depends_on:
foo:
condition: service_started
x-depends-on: depends
foo:
image: busybox
x-foo: bar
Expand All @@ -325,7 +331,7 @@ services:
assert.Check(t, is.DeepEqual(types.Extensions{
"x-project": "project",
}, actual.Extensions))
assert.Check(t, is.Len(actual.Services, 1))
assert.Check(t, is.Len(actual.Services, 2))
service := actual.Services["foo"]
assert.Check(t, is.Equal("busybox", service.Image))

Expand All @@ -341,6 +347,11 @@ services:
assert.Check(t, is.DeepEqual(types.Extensions{
"x-healthcheck": "health",
}, service.HealthCheck.Extensions))

another := actual.Services["another"]
assert.Check(t, is.DeepEqual(types.Extensions{
"x-depends-on": "depends",
}, another.DependsOn["foo"].Extensions))
}

func TestLoadExtends(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions schema/compose-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
"^[a-zA-Z0-9._-]+$": {
"type": "object",
"additionalProperties": false,
"patternProperties": {"^x-": {}},
"properties": {
"restart": {"type": ["boolean", "string"]},
"required": {
Expand Down

0 comments on commit 300b0ed

Please sign in to comment.