Skip to content

Commit 271b966

Browse files
committed
Swarm: allow additional properties in build
Since Swarm does not use the `build` section, there's no reason to validate properties here. This makes it so we don't have to keep updating the schema in the CLI to support properties added in the Compose Spec for build, and does not imply any new feature support since Swarm does not consider this section. Signed-off-by: Laura Brehm <laurabrehm@hey.com>
1 parent e2bfd21 commit 271b966

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

cli/compose/loader/loader_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func strPtr(val string) *string {
179179
}
180180

181181
var sampleConfig = types.Config{
182-
Version: "3.10",
182+
Version: "3.11",
183183
Services: []types.ServiceConfig{
184184
{
185185
Name: "foo",
@@ -488,6 +488,17 @@ services:
488488
assert.Check(t, is.ErrorContains(err, "services.foo.image must be a string"))
489489
}
490490

491+
func TestIgnoreBuildProperties(t *testing.T) {
492+
_, err := loadYAML(`
493+
services:
494+
foo:
495+
image: busybox
496+
build:
497+
unsupported_prop: foo
498+
`)
499+
assert.NilError(t, err)
500+
}
501+
491502
func TestLoadWithEnvironment(t *testing.T) {
492503
config, err := loadYAMLWithEnv(`
493504
version: "3"

cli/compose/schema/data/config_schema_v3.11.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"shm_size": {"type": ["integer", "string"]},
9292
"extra_hosts": {"$ref": "#/definitions/list_or_dict"}
9393
},
94-
"additionalProperties": false
94+
"additionalProperties": true
9595
}
9696
]
9797
},

0 commit comments

Comments
 (0)