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

Add text about extensions #510

Merged
merged 1 commit into from
Sep 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,24 @@ The semantics are the same as `Path`, `Args` and `Env` in [golang Cmd](https://g

**`annotations`** (object, optional) contains arbitrary metadata for the container.
This information MAY be structured or unstructured.
Annotations are key-value maps.
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 SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`.
Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by subsequent specifications.
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing the trailing dot for org.opencontainers..

“subsequent specifications” is unclear to me. Can we follow image-spec and use “… are reserved for future versions of the specification.”?

If there are no annotations then this property MAY either be absent or an empty map.
Implementations that are reading/processing this configuration file MUST NOT generate an error if they encounter an unknown annotation key.
Copy link
Contributor

Choose a reason for hiding this comment

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

“MUST NOT generate an error” doesn't say how they should handle unknown entries. I think we should follow HTML's:

The HTMLUnknownElement interface must be used for HTML elements that are not defined by this specification (or other applicable specifications).

In our case, maybe wording like:

Implementations consuming this configuration MAY log unrecognized annotation keys but MUST otherwise ignore them.

Copy link
Contributor

Choose a reason for hiding this comment

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

And while I abbreviated the “Implementations that are reading/processing this configuration” wording in my suggestion above, I think we should probably just go with “Runtimes”. Do you have other consumers in mind with your more general wording?


```json
"annotations": {
"key1" : "value1",
"key2" : "value2"
"com.example.gpu-cores" : "2"
Copy link
Contributor

Choose a reason for hiding this comment

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

While touching these lines, we have an opportunity to follow jq (and every other JSON pretty-printer I've seen, and drop the space before the colon:

"com.example.gpu-cores": "2"

}
```

## Extensibility
Implementations that are reading/processing this configuration file MUST NOT generate an error if they encounter an unkown property.
Instead they MUST ignore unknown properties.
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 we can combine these last two sentences along the same lines as my annotation suggestion.


## Configuration Schema Example

Here is a full example `config.json` for reference.
Expand Down Expand Up @@ -683,8 +692,8 @@ Here is a full example `config.json` for reference.
"mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811"
},
"annotations": {
"key1": "value1",
"key2": "value2"
"com.example.key1": "value1",
"com.example.key2": "value2"
}
}
```
Expand Down