Add annotations and labels to the Spec.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
This commit is contained in:
Vishnu kannan 2016-03-04 11:10:48 -08:00
parent 0c2892bf82
commit 1c49f4d21c
2 changed files with 15 additions and 0 deletions

View File

@ -18,6 +18,8 @@ type Spec struct {
Mounts []Mount `json:"mounts"`
// Hooks are the commands run at various lifecycle events of the container.
Hooks Hooks `json:"hooks"`
// Annotations is an unstructured key value map that may be set by external tools to store and retrieve arbitrary metadata.
Annotations map[string]string `json:"annotations,omitempty"`
}
// Process contains information to start a specific application inside the container.

View File

@ -231,4 +231,17 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
`args` and `env` are optional.
The semantics are the same as `Path`, `Args` and `Env` in [golang Cmd](https://golang.org/pkg/os/exec/#Cmd).
## Annotations
Annotations are optional arbitrary non-identifying metadata that can be attached to containers.
This information may be large, may be structured or unstructured.
Annotations are key-value maps.
```json
"annotations": {
"key1" : "value1",
"key2" : "value2"
}
```
[uts-namespace]: http://man7.org/linux/man-pages/man7/namespaces.7.html