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 annotations and labels to the Spec. #331

Merged
merged 1 commit into from
Mar 9, 2016
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure we don't want an opaque type here? Or will we just revisit that later when somebody needs something that doesn't fit into a map[string]string?

}

// Process contains information to start a specific application inside the container.
Expand Down
13 changes: 13 additions & 0 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

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

“arbitrary” and ”non-identifying” seem to conflict. I'd expect we want to drop “non-identifying” and just missed it in the reroll that dropped labels.

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