Skip to content

Commit 1c49f4d

Browse files
committed
Add annotations and labels to the Spec.
Signed-off-by: Vishnu kannan <[email protected]>
1 parent 0c2892b commit 1c49f4d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type Spec struct {
1818
Mounts []Mount `json:"mounts"`
1919
// Hooks are the commands run at various lifecycle events of the container.
2020
Hooks Hooks `json:"hooks"`
21+
// Annotations is an unstructured key value map that may be set by external tools to store and retrieve arbitrary metadata.
22+
Annotations map[string]string `json:"annotations,omitempty"`
2123
}
2224

2325
// Process contains information to start a specific application inside the container.

config.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,17 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
231231
`args` and `env` are optional.
232232
The semantics are the same as `Path`, `Args` and `Env` in [golang Cmd](https://golang.org/pkg/os/exec/#Cmd).
233233

234+
## Annotations
235+
236+
Annotations are optional arbitrary non-identifying metadata that can be attached to containers.
237+
This information may be large, may be structured or unstructured.
238+
Annotations are key-value maps.
239+
240+
```json
241+
"annotations": {
242+
"key1" : "value1",
243+
"key2" : "value2"
244+
}
245+
```
246+
234247
[uts-namespace]: http://man7.org/linux/man-pages/man7/namespaces.7.html

0 commit comments

Comments
 (0)