Split validation into fields and service
We want to give feedback to the user as soon as possible about the validity of the config supplied for the services. When extending a service, we can validate that the fields are correct against our schema but we must wait until the *end* of the extends cycle once all of the extended dicts have been merged into the service dict, to perform the final validation check on the config to ensure it is a complete valid service. Doing this before that had happened resulted in false reports of invalid config, as common config when split out, by itself, is not a valid service but *is* valid config to be included. Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
4a8b2947ca
commit
950577d60f
10 changed files with 88 additions and 26 deletions
|
|
@ -1,5 +1,4 @@
|
|||
myweb:
|
||||
extends:
|
||||
file: valid-composite-extends.yml
|
||||
service: web
|
||||
web:
|
||||
command: top
|
||||
|
|
|
|||
5
tests/fixtures/extends/service-with-valid-composite-extends.yml
vendored
Normal file
5
tests/fixtures/extends/service-with-valid-composite-extends.yml
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
myweb:
|
||||
build: '.'
|
||||
extends:
|
||||
file: 'valid-composite-extends.yml'
|
||||
service: web
|
||||
6
tests/fixtures/extends/valid-common-config.yml
vendored
Normal file
6
tests/fixtures/extends/valid-common-config.yml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
myweb:
|
||||
build: '.'
|
||||
extends:
|
||||
file: valid-common.yml
|
||||
service: common-config
|
||||
command: top
|
||||
3
tests/fixtures/extends/valid-common.yml
vendored
Normal file
3
tests/fixtures/extends/valid-common.yml
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
common-config:
|
||||
environment:
|
||||
- FOO=1
|
||||
2
tests/fixtures/extends/valid-composite-extends.yml
vendored
Normal file
2
tests/fixtures/extends/valid-composite-extends.yml
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
web:
|
||||
command: top
|
||||
Loading…
Add table
Add a link
Reference in a new issue