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

config: Convert process.rlimits from an array to an object #583

Closed
wants to merge 1 commit into from

Conversation

wking
Copy link
Contributor

@wking wking commented Sep 27, 2016

Rlimits do not need either ordering or repeat entries for a single type. While come JSON libraries preserve object key order or allow repeats, there are many JSON libraries which do not (e.g. Python and JavaScript both parse JSON objects into hash tables). Using objects here reinforces the unimportance of ordering or repeated entries.

Also add Solaris support. I'm not entirely clear on this, because while Solaris is POSIX-certified system and there is a Solaris man page for setrlimit, @anuthan claims no Solaris support for rlimits.

The additionalProperties object bit comes from here, although it is not documented in draft 4 of the JSON Schema RFC.

@crosbymichael
Copy link
Member

uhh, just because order is not important does not mean you have to change the schema

@wking
Copy link
Contributor Author

wking commented Sep 27, 2016

On Tue, Sep 27, 2016 at 09:04:54AM -0700, Michael Crosby wrote:

uhh, just because order is not important does not mean you have to
change the schema

True, but using an array means entries are referenced by index
(e.g. ‘rlimits[0]’, but I think validation output would be easier to
read if they were referenced by resource (e.g.
‘rlimits["RLIMIT_CORE"]’). opencontainers/runtime-tools#223 is
currently (with opencontainers/runtime-tools@f175fae0) using the
resource in validation error messages 1, which assumes there will be
no duplicates. I'd rather make that an explicit requirement, and
converting to an object here sets us up for that (I've just filed #584
with the other half of making that explicit).

Rlimits do not need either ordering or repeat entries for a single
type.  Using an object leans on the new wording from eeaccfa
(glossary: Make objects explicitly unordered and forbid duplicate
names, 2016-09-27, opencontainers#584) to make both of those points explicit.

Also add Solaris support.  I'm not entirely clear on this, because
while Solaris is POSIX-certified system and there is a Solaris man
page for setrlimit, Abhijeeth claims no Solaris support for rlimits
[1].

The additionalProperties object bit comes from [2,3], although it is
not documented in draft 4 of the JSON Schema RFC [4].

[1]: opencontainers#564 (comment)
[2]: https://spacetelescope.github.io/understanding-json-schema/reference/object.html#properties
[3]: https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-5.18
[4]: https://tools.ietf.org/html/draft-zyp-json-schema-04

Signed-off-by: W. Trevor King <wking@tremily.us>
hqhq added a commit to hqhq/runtime-spec that referenced this pull request Nov 3, 2016
Alternative of opencontainers#583 , as what we do for `namespaces`
in opencontainers#597 .

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
@wking wking force-pushed the rlimits-object branch 2 times, most recently from 02e284f to bde2aa9 Compare November 3, 2016 03:38
@mrunalp
Copy link
Contributor

mrunalp commented Jan 11, 2017

Closed by #607

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.

3 participants