Skip to content

Conversation

@zhouhao3
Copy link

@zhouhao3 zhouhao3 commented Mar 3, 2017

I think we should increase the judgment of several OS.
https://github.com/opencontainers/runtime-spec/blame/master/config.md#L324

Signed-off-by: zhouhao [email protected]

@zhouhao3 zhouhao3 force-pushed the fix-plat branch 2 times, most recently from 4a08bf7 to d1898f7 Compare March 3, 2017 09:09
@zhouhao3
Copy link
Author

zhouhao3 commented Mar 3, 2017

I will add the Windows type after updating the runtime-spec version (which I am going to do).


if v.spec.Platform.OS != "linux" {
if v.spec.Linux != nil {
msgs = append(msgs, fmt.Sprintf("When system is not linux, Linux field should be empty"))
Copy link
Contributor

@wking wking Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@zhouhao3 zhouhao3 Mar 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But spec has changed in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But spec has changed in this PR.

Ah, I'd missed that (that PR changed a lot ;). I'm not sure how the new approach will scale to a vm section if/when VM support lands in the spec, but I guess we'll see.

Anyhow, thanks for re-citing master. I'm fine with your implementation landing as soon as runtime-tools switches from targeting v1.0.0-rc4 (which has the old language) to rc5 (or whichever spec release we target next which has the new language).

As a minor nit, I'd recommend wording that more closely follows the spec. Something like:

msgs = append(msgs, fmt.Sprintf("'linux' MUST NOT be set when platform.os is %q", v.spec.Platform.OS))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated,thanks for your advice.

@Mashimiao
Copy link

Mashimiao commented Mar 6, 2017

LGTM

Approved with PullApprove


if v.spec.Platform.OS != "linux" {
if v.spec.Linux != nil {
msgs = append(msgs, fmt.Sprintf("'linux' MUST NOT set when platform.os is %q", v.spec.Platform.OS))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: MUST NOT be set


if v.spec.Platform.OS != "solaris" {
if v.spec.Solaris != nil {
msgs = append(msgs, fmt.Sprintf("'solaris' MUST NOT set when platform.os is %q", v.spec.Platform.OS))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, PTAL

Signed-off-by: zhouhao <[email protected]>
@Mashimiao
Copy link

Mashimiao commented Mar 7, 2017

LGTM

Approved with PullApprove

1 similar comment
@mrunalp
Copy link
Contributor

mrunalp commented Mar 7, 2017

LGTM

Approved with PullApprove

@mrunalp mrunalp merged commit 245e0b2 into opencontainers:master Mar 7, 2017
@zhouhao3 zhouhao3 deleted the fix-plat branch March 8, 2017 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants