diff --git a/cli/compose/loader/loader_test.go b/cli/compose/loader/loader_test.go index 1acd16bc2e..0be15d2fa4 100644 --- a/cli/compose/loader/loader_test.go +++ b/cli/compose/loader/loader_test.go @@ -179,7 +179,7 @@ func strPtr(val string) *string { } var sampleConfig = types.Config{ - Version: "3.10", + Version: "3.11", Services: []types.ServiceConfig{ { Name: "foo", @@ -488,6 +488,17 @@ services: assert.Check(t, is.ErrorContains(err, "services.foo.image must be a string")) } +func TestIgnoreBuildProperties(t *testing.T) { + _, err := loadYAML(` +services: + foo: + image: busybox + build: + unsupported_prop: foo +`) + assert.NilError(t, err) +} + func TestLoadWithEnvironment(t *testing.T) { config, err := loadYAMLWithEnv(` version: "3" diff --git a/cli/compose/schema/data/config_schema_v3.11.json b/cli/compose/schema/data/config_schema_v3.11.json index 3607514ee7..fb2c9fd84b 100644 --- a/cli/compose/schema/data/config_schema_v3.11.json +++ b/cli/compose/schema/data/config_schema_v3.11.json @@ -91,7 +91,7 @@ "shm_size": {"type": ["integer", "string"]}, "extra_hosts": {"$ref": "#/definitions/list_or_dict"} }, - "additionalProperties": false + "additionalProperties": true } ] },