Skip to content

Commit 8ce3fa0

Browse files
committed
ci/compose/schema: migrate to github.com/santhosh-tekuri/jsonschema/v6
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 28f7560 commit 8ce3fa0

123 files changed

Lines changed: 24594 additions & 6405 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cli/compose/loader/loader_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -419,15 +419,15 @@ services:
419419
foo:
420420
image: busybox
421421
`)
422-
assert.Check(t, is.ErrorContains(err, "version must be a string"))
422+
assert.Check(t, is.ErrorContains(err, "version: must be a string"))
423423
}
424424

425425
func TestV1Unsupported(t *testing.T) {
426426
_, err := loadYAML(`
427427
foo:
428428
image: busybox
429429
`)
430-
assert.Check(t, is.ErrorContains(err, "(root) Additional property foo is not allowed"))
430+
assert.Check(t, is.ErrorContains(err, "(root): additional property 'foo' is not allowed"))
431431

432432
_, err = loadYAML(`
433433
version: "1.0"
@@ -445,44 +445,44 @@ services:
445445
- foo:
446446
image: busybox
447447
`)
448-
assert.Check(t, is.ErrorContains(err, "services must be a mapping"))
448+
assert.Check(t, is.ErrorContains(err, "services: must be a mapping"))
449449

450450
_, err = loadYAML(`
451451
version: "3"
452452
services:
453453
foo: busybox
454454
`)
455-
assert.Check(t, is.ErrorContains(err, "services.foo must be a mapping"))
455+
assert.Check(t, is.ErrorContains(err, "services.foo: must be a mapping"))
456456

457457
_, err = loadYAML(`
458458
version: "3"
459459
networks:
460460
- default:
461461
driver: bridge
462462
`)
463-
assert.Check(t, is.ErrorContains(err, "networks must be a mapping"))
463+
assert.Check(t, is.ErrorContains(err, "networks: must be a mapping"))
464464

465465
_, err = loadYAML(`
466466
version: "3"
467467
networks:
468468
default: bridge
469469
`)
470-
assert.Check(t, is.ErrorContains(err, "networks.default must be a mapping"))
470+
assert.Check(t, is.ErrorContains(err, "networks.default: must be null or a mapping"))
471471

472472
_, err = loadYAML(`
473473
version: "3"
474474
volumes:
475475
- data:
476476
driver: local
477477
`)
478-
assert.Check(t, is.ErrorContains(err, "volumes must be a mapping"))
478+
assert.Check(t, is.ErrorContains(err, "volumes: must be a mapping"))
479479

480480
_, err = loadYAML(`
481481
version: "3"
482482
volumes:
483483
data: local
484484
`)
485-
assert.Check(t, is.ErrorContains(err, "volumes.data must be a mapping"))
485+
assert.Check(t, is.ErrorContains(err, "volumes.data: must be null or a mapping"))
486486
}
487487

488488
func TestNonStringImage(t *testing.T) {
@@ -492,7 +492,7 @@ services:
492492
foo:
493493
image: ["busybox", "latest"]
494494
`)
495-
assert.Check(t, is.ErrorContains(err, "services.foo.image must be a string"))
495+
assert.Check(t, is.ErrorContains(err, "services.foo.image: must be a string"))
496496
}
497497

498498
func TestIgnoreBuildProperties(t *testing.T) {
@@ -553,7 +553,7 @@ services:
553553
environment:
554554
FOO: ["1"]
555555
`)
556-
assert.Check(t, is.ErrorContains(err, "services.dict-env.environment.FOO must be a string, number or null"))
556+
assert.Check(t, is.ErrorContains(err, "services.dict-env.environment.FOO: must be null or a number or a string"))
557557
}
558558

559559
func TestInvalidEnvironmentObject(t *testing.T) {
@@ -564,7 +564,7 @@ services:
564564
image: busybox
565565
environment: "FOO=1"
566566
`)
567-
assert.Check(t, is.ErrorContains(err, "services.dict-env.environment must be a mapping"))
567+
assert.Check(t, is.ErrorContains(err, "services.dict-env.environment: must be a mapping"))
568568
}
569569

570570
func TestLoadWithEnvironmentInterpolation(t *testing.T) {
@@ -899,7 +899,7 @@ func TestInvalidResource(t *testing.T) {
899899
impossible:
900900
x: 1
901901
`)
902-
assert.Check(t, is.ErrorContains(err, "Additional property impossible is not allowed"))
902+
assert.Check(t, is.ErrorContains(err, "additional property 'impossible' is not allowed"))
903903
}
904904

905905
func TestInvalidExternalAndDriverCombination(t *testing.T) {
@@ -1033,7 +1033,7 @@ services:
10331033
tmpfs:
10341034
size: 10000
10351035
`)
1036-
assert.Check(t, is.ErrorContains(err, "services.tmpfs.volumes.0 Additional property tmpfs is not allowed"))
1036+
assert.Check(t, is.ErrorContains(err, "services.tmpfs.volumes.0: additional property 'tmpfs' is not allowed"))
10371037
}
10381038

10391039
func TestLoadBindMountSourceMustNotBeEmpty(t *testing.T) {
@@ -1191,7 +1191,7 @@ services:
11911191
tmpfs:
11921192
size: -1
11931193
`)
1194-
assert.ErrorContains(t, err, "services.tmpfs.volumes.0.tmpfs.size Must be greater than or equal to 0")
1194+
assert.ErrorContains(t, err, "services.tmpfs.volumes.0.tmpfs.size: must be greater than or equal to 0")
11951195
}
11961196

11971197
func TestLoadTmpfsVolumeSizeMustBeInteger(t *testing.T) {
@@ -1206,7 +1206,7 @@ services:
12061206
tmpfs:
12071207
size: 0.0001
12081208
`)
1209-
assert.ErrorContains(t, err, "services.tmpfs.volumes.0.tmpfs.size must be a integer")
1209+
assert.ErrorContains(t, err, "services.tmpfs.volumes.0.tmpfs.size: must be a integer")
12101210
}
12111211

12121212
func serviceSort(services []types.ServiceConfig) []types.ServiceConfig {

0 commit comments

Comments
 (0)