validate: add the validation of Resources.devices#374
Merged
Mashimiao merged 2 commits intoopencontainers:masterfrom Aug 30, 2017
Merged
validate: add the validation of Resources.devices#374Mashimiao merged 2 commits intoopencontainers:masterfrom
Mashimiao merged 2 commits intoopencontainers:masterfrom
Conversation
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
Member
|
resources.devices.access? r.Resources.Devices[index].Access)) |
Contributor
|
I'd rather handle this sort of value validation by using the spec's
JSON Schema (see the in-flight #197).
|
|
LGTM |
Author
|
@liangchenye @mrunalp PTAL |
Contributor
|
On Fri, May 05, 2017 at 02:51:31AM -0700, Ma Shimiao wrote:
It's hard to exactly check composition of r, w, m in JSON schema as
I tried in runtime-spec/#690 and has been rejected.
opencontainers/runtime-spec#690 was a stronger check than what we're
checking here (since as of f6e16e8 this allows more than three
characters). That PR wasn't closed because of a JSON Schema
limitation, it was closed because the spec doesn't like carrying
kernel limits (even though these particular limits are still listed in
the spec [1]). But I don't think “included in the spec but not in the
JSON Schema” is a particularly consistent position, so I'd rather
revisit the JSON Schema approach to this or drop the valid-value
listing from the spec Markdown. Either way, I don't think we need a
Go check for these values in runtime-tools.
[1]: https://github.com/opencontainers/runtime-spec/blame/v1.0.0-rc5/config-linux.md#L223
|
Author
|
ping @liangchenye @mrunalp |
Author
|
@liangchenye @mrunalp PTAL |
Member
|
We can drop this kind of validation when the JSON schema validation is adopted in runtime-tools. @q384566678 @Mashimiao will you try to integrate that? |
Member
1 similar comment
Author
|
@liangchenye I will try to do this. |
This file contains hidden or 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
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.
According to the following spec:
devices.type
devices.access
Signed-off-by: zhouhao zhouhao@cn.fujitsu.com