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>
This commit is contained in:
Laura Brehm 2023-04-18 14:51:49 +01:00
parent e2bfd21991
commit 271b9667ee
No known key found for this signature in database
GPG Key ID: 526E3FC49260D47A
2 changed files with 13 additions and 2 deletions

View File

@ -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"

View File

@ -91,7 +91,7 @@
"shm_size": {"type": ["integer", "string"]},
"extra_hosts": {"$ref": "#/definitions/list_or_dict"}
},
"additionalProperties": false
"additionalProperties": true
}
]
},