Skip to content

Commit

Permalink
Add labels to the state
Browse files Browse the repository at this point in the history
`Labels` is used to store some runtime specified informations,
these informations may be meaningless to other runtime, but it's
userful for the same runtime to operate this container.

Signed-off-by: Gao feng <[email protected]>
  • Loading branch information
gao-feng committed Oct 9, 2015
1 parent 83e5943 commit 01e08c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ type State struct {
Pid int `json:"pid"`
// Root is the path to the container's bundle directory.
Root string `json:"root"`
// Lables is the runtime itself specified information.
Labels map[string]string `json:"labels"`
}
1 change: 1 addition & 0 deletions runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ By providing a default location that container state is stored external applicat
* **id** (string) ID is the container's ID.
* **pid** (int) Pid is the ID of the main process within the container.
* **root** (string) Root is the path to the container's bundle directory.
* **Labels** (map) Labels is the runtime itself specified information.

The ID is provided in the state because hooks will be executed with the state as the payload.
This allows the hook to perform clean and teardown logic after the runtime destroys its own state.
Expand Down

0 comments on commit 01e08c0

Please sign in to comment.