-
Notifications
You must be signed in to change notification settings - Fork 553
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: Bring "unique... within this map" back together #654
Merged
Conversation
This file contains 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
Pull the empty-key restriction out into its own sentence (instead of leaving it in the middle of the uniqueness restriction). Drop the "best practice" portion, because the following line is "Keys SHOULD be named using a reverse domain notation...", which covers that idea more explicitly. Signed-off-by: W. Trevor King <[email protected]>
dqminh
reviewed
Jan 13, 2017
@@ -393,7 +393,8 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin | |||
This information MAY be structured or unstructured. | |||
Annotations MUST be a key-value map where both the key and value MUST be strings. | |||
While the value MUST be present, it MAY be an empty string. | |||
Keys MUST be unique and MUST NOT be an empty string within this map, and best practice is to namespace the keys. | |||
Keys MUST be unique within this map. | |||
Keys MUST NOT be an empty string. | |||
Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while we are here, its also clearer to me when we restructure the above paragraph to follow one a keyword per line.
For example
Annotations MUST be a key-value map
Keys MUST be string.
Keys MUST be unique within this map.
Keys MUST NOT be empty.
Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by subsequent specifications.
Values MUST be string.
Values MUST be present.
Values MAY be empty.
wdyt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As recommended by Daniel [1], although I've adjusted his recommended wording slightly and split the requirements into paragraphs. [1]: opencontainers#654 (comment) Signed-off-by: W. Trevor King <[email protected]>
1 similar comment
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
May 26, 2017
This condition landed in 27a05de (Add text about extensions, 2016-06-26, opencontainers#510) with subsequent wording tweaks in 3f0440b (config.md: add empty limit for key of annotations, Dec 28 10:35:19 2016, opencontainers#645) and 2c8feeb (config: Bring "unique... within this map" back together, 2017-01-12, opencontainers#654). However, since eeaccfa (glossary: Make objects explicitly unordered and forbid duplicate names, 2016-09-27, opencontainers#584) we forbid duplicate keys on *all* objects (not just annotations), so this PR removes the redundant annotation-specific condition. Signed-off-by: W. Trevor King <[email protected]>
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
Jun 1, 2017
This condition landed in 27a05de (Add text about extensions, 2016-06-26, opencontainers#510) with subsequent wording tweaks in 3f0440b (config.md: add empty limit for key of annotations, Dec 28 10:35:19 2016, opencontainers#645) and 2c8feeb (config: Bring "unique... within this map" back together, 2017-01-12, opencontainers#654). However, since eeaccfa (glossary: Make objects explicitly unordered and forbid duplicate names, 2016-09-27, opencontainers#584) we forbid duplicate keys on *all* objects (not just annotations), so this PR removes the redundant annotation-specific condition. Signed-off-by: W. Trevor King <[email protected]>
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.
This PR is my suggestion from #645, which @dqminh thumbs-upped, but which didn't make it in before #645 landed.
Pull the empty-key restriction out into its own sentence (instead of leaving it in the middle of the uniqueness restriction).
Drop the “best practice” portion, because the following line is “Keys SHOULD be named using a reverse domain notation…”, which covers that idea more explicitly.