Skip to content

Commit 01e08c0

Browse files
committed
Add labels to the state
`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]>
1 parent 83e5943 commit 01e08c0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

config.go

+2
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,6 @@ type State struct {
6767
Pid int `json:"pid"`
6868
// Root is the path to the container's bundle directory.
6969
Root string `json:"root"`
70+
// Lables is the runtime itself specified information.
71+
Labels map[string]string `json:"labels"`
7072
}

runtime.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ By providing a default location that container state is stored external applicat
1313
* **id** (string) ID is the container's ID.
1414
* **pid** (int) Pid is the ID of the main process within the container.
1515
* **root** (string) Root is the path to the container's bundle directory.
16+
* **Labels** (map) Labels is the runtime itself specified information.
1617

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

0 commit comments

Comments
 (0)