Skip to content
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

add omitempty to 'Devices #340

Merged
merged 1 commit into from
Mar 16, 2016
Merged

add omitempty to 'Devices #340

merged 1 commit into from
Mar 16, 2016

Conversation

liangchenye
Copy link
Member

  1. Add 'omitempty' to 'Device'.
  2. remove the 'seccomp' and 'device' from the example since they are not necessary
  3. change the device type description c to "c" since it became a string.

Signed-off-by: liangchenye liangchenye@huawei.com

@mrunalp
Copy link
Contributor

mrunalp commented Mar 10, 2016

LGTM

@@ -130,7 +130,7 @@ type Linux struct {
// Namespaces contains the namespaces that are created and/or joined by the container
Namespaces []Namespace `json:"namespaces"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't namespaces optional as well?

@crosbymichael
Copy link
Member

Why do we have to remove fields from the EXAMPLES? They are examples, if you don't have fields in examples where are people going to learn about them?

@wking
Copy link
Contributor

wking commented Mar 10, 2016

On Thu, Mar 10, 2016 at 10:25:56AM -0800, Michael Crosby wrote:

Why do we have to remove fields from the EXAMPLES? They are
examples, if you don't have fields in examples where are people
going to learn about them?

I think we should either remove optional fields or fill them in with
meaningful values 1. Discovery should be through the parent field's
documentation [2,3].

@liangchenye
Copy link
Member Author

Same with Wking, I think we can just keep the meaningful value.

@@ -99,7 +99,7 @@ The runtime may supply them however it likes (with [mknod][mknod.2], by bind mou

The following parameters can be specified:

* **`type`** *(string, required)* - type of device: `c`, `b`, `u` or `p`.
* **`type`** *(string, required)* - type of device: "c", "b", "u" or "p".
More info in [mknod(1)][mknod.1].
* **`path`** *(string, required)* - full path to device inside container.
* **`major, minor`** *(int64, required unless **`type`** is `p`)* - [major, minor numbers][devices] for the device.
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to change p here and below in Device whitelist section as well. Anyway I don't see this necessary, because I don't think there is inkling for a specific type with backticks since it's just consistent usage for markdown. See discussion in #323 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

On Thu, Mar 10, 2016 at 06:36:58PM -0800, Qiang Huang wrote:

@@ -99,7 +99,7 @@ The runtime may supply them however it likes (with [mknod][mknod.2], by bind mou

The following parameters can be specified:

-* type (string, required) - type of device: c, b, u or p.
+* type (string, required) - type of device: "c", "b", "u" or "p".
More info in [mknod(1)][mknod.1].

  • path (string, required) - full path to device inside container.
  • major, minor (int64, required unless *type** is p)* - [major, minor numbers][devices] for the device.

You might want to change p here and below in Device whitelist
section as well. Anyway I don't see this necessary, because I don't
think there is inkling for a specific type with backticks since it's
just consistent usage for markdown. See discussion in
#323 (comment)

I think the style we choose is less important thant that we pick
something and document it in 1 for consistency. Having to think
about this whenever someone inserts a string literal in new docs is
wasted time ;).

Signed-off-by: liangchenye <liangchenye@huawei.com>
@liangchenye
Copy link
Member Author

@hqhq yes, remove the unnecessary change.
@vishh new update also adds omitempty to 'namespace'

@vbatts
Copy link
Member

vbatts commented Mar 16, 2016

LGTM

and while this removes the empty values, i'll fix via #344

vbatts added a commit that referenced this pull request Mar 16, 2016
@vbatts vbatts merged commit 4d4a079 into opencontainers:master Mar 16, 2016
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Aug 3, 2016
To match the omitempty which the Go property has had since 28cc423
(add omitempty to 'Device' and 'Namespace', 2016-03-10, opencontainers#340).

Signed-off-by: W. Trevor King <wking@tremily.us>
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Aug 3, 2016
To match the omitempty which the Go property has had since 28cc423
(add omitempty to 'Device' and 'Namespace', 2016-03-10, opencontainers#340).

Signed-off-by: W. Trevor King <wking@tremily.us>
Mashimiao pushed a commit to Mashimiao/specs that referenced this pull request Aug 19, 2016
To match the omitempty which the Go property has had since 28cc423
(add omitempty to 'Device' and 'Namespace', 2016-03-10, opencontainers#340).

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants