diff --git a/config.go b/config.go index 8fd6b4d5a..89c7327ff 100644 --- a/config.go +++ b/config.go @@ -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. diff --git a/config.md b/config.md index fb1221057..e4ef04083 100644 --- a/config.md +++ b/config.md @@ -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