You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
runtime-spec publishes a JSON Schema covering the configuration format
(and other JSON related to runtime-spec) [1]. Reduce duplication of
effort by validating configurations against that schema. For example
this gives us lots allowed value/type checking:
$ cat config.json
{
"ociVersion": "1.0.0-rc6",
"process": {
"cwd": "/",
"args": [
"sh"
],
"user": {
"uid": 1,
"gid": 1
},
"rlimits": [{}]
},
"root": {
"path": "rootfs"
}
}
$ ./oci-runtime-tool validate
3 Errors detected:
process.rlimits.0.type: Does not match pattern '^RLIMIT_[A-Z]+$'
'POSIXRlimit.Type' should not be empty.
rlimit type "" is invalid
without us having to duplicate all the work that the runtime-spec
folks have already done for us.
Only validating the JSON Schema is not sufficient, because
--host-specific (e.g. you're running on a Linux box) and
cross-property constraits (e.g. must create a new UTS namespace if you
set hostname) are difficult/impossible to express in JSON Schema.
The 1.0.0-rc5 test is an example of pulling in JSON Schema from an
older release, since the 'process' property was required in rc5 and
optional in rc6, with opencontainers/runtime-spec@c41ea83d, config:
Make process optional, 2017-02-27, #701) landing in between.
[1]: https://github.com/opencontainers/runtime-spec/tree/v1.0.0-rc2/schema
Signed-off-by: W. Trevor King <[email protected]>
0 commit comments