Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
specs-go/config: Make Linux and Solaris omitempty (again)
I'd added some omitempties in 5c2193f (specs-go/config: Make Linux and Solaris omitempty, 2016-05-06, opencontainers#431), but it turns out to not have the intended effect unless the field is also a pointer type (even after I shifted the 'omitempty' from the platform tag to the json tag). Before this commit: $ ./ocitools generate --template <(echo '{}') $ jq . config.json { "ociVersion": "1.0.0-rc1-dev", "platform": { "os": "linux", "arch": "amd64" }, "process": { "user": { "uid": 0, "gid": 0 }, "args": [], "cwd": "/" }, "root": { "path": "rootfs" }, "hooks": {}, "linux": { "cgroupsPath": "" }, "solaris": { "cappedCPU": {}, "cappedMemory": {} } } And after this commit: $ ./ocitools generate --template <(echo '{}') $ jq . config.json { "ociVersion": "1.0.0-rc1-dev", "platform": { "os": "linux", "arch": "amd64" }, "process": { "user": { "uid": 0, "gid": 0 }, "args": [], "cwd": "/" }, "root": { "path": "rootfs" }, "hooks": {}, } The remaining useless properties are addressed by other in-flight pull requests: * 5ca74df (config: Make 'process.args' optional, 2016-06-04, opencontainers#489) * ad33f9c (config: Explicitly list 'hooks' as optional, 2016-05-06, opencontainers#427) So I've left them alone here. Signed-off-by: W. Trevor King <wking@tremily.us>
- Loading branch information