-
Notifications
You must be signed in to change notification settings - Fork 554
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.md: add empty limit for key of annotations #645
config.md: add empty limit for key of annotations #645
Conversation
empty key does not make any senses, we should limit it. Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
@@ -388,7 +388,7 @@ The semantics are the same as `Path`, `Args` and `Env` in [golang Cmd](https://g | |||
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 within this map, and best practice is to namespace the keys. | |||
Keys MUST be unique and MUST NOT be an empty string within this map, and best practice is to namespace the keys. |
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.
I'd rather not split “unique within this map”. How about splitting each idea into its own sentence:
Keys MUST be unique within this map.
Keys MUST NOT be an empty string.
We can 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. If we want to give explicit namespacing advice to annotation-spec devs without access to a domain name, I'd rather address that directly (in a separate PR?).
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 <wking@tremily.us>
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 <wking@tremily.us>
empty key does not make any senses, we should limit it.
Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com