mirror of https://github.com/docker/cli.git
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:
parent
e2bfd21991
commit
271b9667ee
|
@ -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"
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
"shm_size": {"type": ["integer", "string"]},
|
||||
"extra_hosts": {"$ref": "#/definitions/list_or_dict"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
"additionalProperties": true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue