From 300b0ed79685d4b181f6382822d81861816b26e3 Mon Sep 17 00:00:00 2001 From: Joana Hrotko Date: Tue, 9 Jul 2024 14:15:01 +0100 Subject: [PATCH] add x- extensions to depends_on Signed-off-by: Joana Hrotko --- loader/loader_test.go | 13 ++++++++++++- schema/compose-spec.json | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/loader/loader_test.go b/loader/loader_test.go index 5c93e697..c9472115 100644 --- a/loader/loader_test.go +++ b/loader/loader_test.go @@ -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 @@ -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)) @@ -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) { diff --git a/schema/compose-spec.json b/schema/compose-spec.json index 69bbfcc2..11a733b4 100644 --- a/schema/compose-spec.json +++ b/schema/compose-spec.json @@ -197,6 +197,7 @@ "^[a-zA-Z0-9._-]+$": { "type": "object", "additionalProperties": false, + "patternProperties": {"^x-": {}}, "properties": { "restart": {"type": ["boolean", "string"]}, "required": {