Skip to content

Conversation

@Mashimiao
Copy link

In Linux, only when type is a, access can be unset. So, I think if we have to make access as OPTIONAL, let it to be rwm as default may be better.

Signed-off-by: Ma Shimiao [email protected]

@crosbymichael
Copy link
Member

We usually error towards secure and explicit. This change would be the opposite of both.

@wking
Copy link
Contributor

wking commented Aug 25, 2017 via email

@Mashimiao
Copy link
Author

Mashimiao commented Aug 28, 2017 via email

@Mashimiao Mashimiao force-pushed the device-cgroup-default branch from f50c5dd to 0a245ef Compare August 31, 2017 08:31
@Mashimiao Mashimiao changed the title add default value for access of device cgroup access of device cgroup is optional depends on type Aug 31, 2017
@Mashimiao
Copy link
Author

updated, PTAL

config-linux.md Outdated
Unset value means "all", mapping to [`*` in the filesystem API][cgroup-v1-devices].
* **`access`** *(string, OPTIONAL)* - cgroup permissions for device.
A composition of `r` (read), `w` (write), and `m` (mknod).
* When type is not `a`, `access` is REQUIRED.
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't define our property-specification syntax (I'd taken a stab at that in #747, see requirement-condition here), but our current pattern for conditionally-required properties would be:

  • access (string, REQUIRED when type is b or c) - cgroup permissions for device.
    A composition…

Existing examples are:

$ git grep 'REQUIRED \(when\|unless\)' v1.0.0 --
v1.0.0:config-linux.md:* **`major, minor`** *(int64, REQUIRED unless `type` is `p`)* - [major, minor numbers][devices] for the device.
v1.0.0:config.md:    This property is REQUIRED when [`start`](runtime.md#start) is called.
v1.0.0:runtime.md:* **`pid`** (int, REQUIRED when `status` is `created` or `running` on Linux, OPTIONAL on other platforms) is the ID of the container process, as seen by the host.

@Mashimiao Mashimiao force-pushed the device-cgroup-default branch from 0a245ef to c997e61 Compare September 1, 2017 01:26
@Mashimiao
Copy link
Author

Mashimiao commented Sep 1, 2017 via email

Unset values mean "all", mapping to [`*` in the filesystem API][cgroup-v1-devices].
* **`access`** *(string, OPTIONAL)* - cgroup permissions for device.
Unset value means "all", mapping to [`*` in the filesystem API][cgroup-v1-devices].
* **`access`** *(string, REQUIRED unless `type` is `a`)* - cgroup permissions for device.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this phrasing leaves the type-unset case (where type is only effectively a) less clear than my earlier recomendation. But whatever, I expect folks will get the idea.

Copy link
Author

Choose a reason for hiding this comment

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

I prefer this one, because when type is unset it mapped to a, so we may can say type is always set.

@Mashimiao
Copy link
Author

ping @opencontainers/runtime-spec-maintainers

1 similar comment
@Mashimiao
Copy link
Author

ping @opencontainers/runtime-spec-maintainers

@vbatts
Copy link
Member

vbatts commented Dec 17, 2019

👎
The fewer conditional REQUIRED's, the better.

@vbatts vbatts closed this Dec 17, 2019
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