docker-app inspect command should print the missing settings and warn if any setting is unused in the compose file
docker-app inspect print the settings it founds in the settings.yaml file, but some settings may be missing and should be added manually while rendering or deploying the app.
Some other settings can also be forgotten by the user during a refactoring and are now unused.
Something like this
$ cat settings-app.dockerapp
# Version of the application
version: 0.1.0
# Name of the application
name: settings-app
---
version: '3.3'
services:
myservice:
image: myprefix/my-image:${myservice.missing.tag}
ports:
- "${myservice.used.port}:80"
---
# Settings.
myservice:
used:
port: 8080
unused:
port: 8081
Inspect should print something like this:
$ docker-app inspect settings-app.dockerapp
settings-app 0.1.0
Setting Default
------- -------
myservice.used.port 8080
Missing Setting
---------------
myservice.missing.tag
Unused Setting Default
-------------- -------
myservice.unused.port 8081
Out of interest does validate catch this?
Looks like this is mostly done?
$ cat > test.dockerapp <<EOF
# Version of the application
version: 0.1.0
# Name of the application
name: settings-app
---
version: '3.3'
services:
myservice:
image: myprefix/my-image:${myservice.missing.tag}
ports:
- "${myservice.used.port}:80"
---
# Settings.
myservice:
used:
port: 8080
unused:
port: 8081
EOF
$ ./bin/docker-app validate test
Error: failed to load Compose file: invalid interpolation format for services.myservice.image: "required variable myservice.missing.tag is missing a value". You may need to escape any $ with another $.
$ ./bin/docker-app inspect test
Error: failed to load Compose file: invalid interpolation format for services.myservice.image: "required variable myservice.missing.tag is missing a value". You may need to escape any $ with another $.
The "required variable myservice.missing.tag is missing a value" is a bit buried, but it's there.
Well, validate is done, but @silvin-lubecki's request for inspect to more clearly express it remains, I guess #425 is related.