-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
specs-go/config: Make Linux and Solaris omitempty #431
Merged
mrunalp
merged 2 commits into
opencontainers:master
from
wking:platform-specific-solaris
May 9, 2016
Merged
specs-go/config: Make Linux and Solaris omitempty #431
mrunalp
merged 2 commits into
opencontainers:master
from
wking:platform-specific-solaris
May 9, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixup for 7c9daeb (Introducing Solaris in OCI, 2016-04-25, opencontainers#411) along the lines of b373a15 (config: Split platform-specific configuration into its own section, 2016-05-02, opencontainers#414). Signed-off-by: W. Trevor King <wking@tremily.us>
Both fields are optional, so you could conceivably have neither. However, in most cases folks will populate the one corresponding to their platform. The one that *doesn't* match their platform must not show up, in order to avoid violating the: This should only be set if **`platform.os`** is ... phrasing. Signed-off-by: W. Trevor King <wking@tremily.us>
LGTM |
1 similar comment
LGTM |
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
May 16, 2016
This should have been part of 759ee79 (config: Add platform-specific entry for 'solaris', 2016-05-06, opencontainers#431), since the example has playform.os set to 'linux'. There was some (brief) discussion of this point before the 'solaris' section landed [1], but the "should only be set if" wording landed in parallel via b373a15 (config: Split platform-specific configuration into its own section, 2016-05-02, opencontainers#414), and I'd forgotten to go back and apply that logic to opencontainers#411. Having a full Solaris example would be useful, but I think it should be a separate, Solaris-only example. [1]: opencontainers#411 (comment) Signed-off-by: W. Trevor King <wking@tremily.us>
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
May 16, 2016
This should have been part of 759ee79 (config: Add platform-specific entry for 'solaris', 2016-05-06, opencontainers#431), since the example has platform.os set to 'linux'. There was some (brief) discussion of this point before the 'solaris' section landed [1], but the "should only be set if" wording landed in parallel via b373a15 (config: Split platform-specific configuration into its own section, 2016-05-02, opencontainers#414), and I'd forgotten to go back and apply that logic to opencontainers#411. Having a full Solaris example would be useful, but I think it should be a separate, Solaris-only example. [1]: opencontainers#411 (comment) Signed-off-by: W. Trevor King <wking@tremily.us>
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
Jun 18, 2016
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. 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>
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
Jun 18, 2016
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 $ ./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>
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
Jun 18, 2016
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>
Mashimiao
pushed a commit
to Mashimiao/specs
that referenced
this pull request
Aug 19, 2016
This should have been part of 759ee79 (config: Add platform-specific entry for 'solaris', 2016-05-06, opencontainers#431), since the example has platform.os set to 'linux'. There was some (brief) discussion of this point before the 'solaris' section landed [1], but the "should only be set if" wording landed in parallel via b373a15 (config: Split platform-specific configuration into its own section, 2016-05-02, opencontainers#414), and I'd forgotten to go back and apply that logic to opencontainers#411. Having a full Solaris example would be useful, but I think it should be a separate, Solaris-only example. [1]: opencontainers#411 (comment) Signed-off-by: W. Trevor King <wking@tremily.us>
Mashimiao
pushed a commit
to Mashimiao/specs
that referenced
this pull request
Aug 19, 2016
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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also document
solaris
in the platform-specific configurationsection. Details in the commit messages.