Skip to content

Commit 66ad83f

Browse files
Renaud GaubertthaJeztah
andcommitted
Use dedicated type for Container State
Co-authored-by: Sebastiaan van Stijn <[email protected]> Signed-off-by: Renaud Gaubert <[email protected]>
1 parent 89419f0 commit 66ad83f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

specs-go/state.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
package specs
22

3+
// ContainerState represents the state of a container.
4+
type ContainerState string
5+
36
const (
47
// StateCreating indicates that the container is being created
5-
StateCreating = "creating"
8+
StateCreating ContainerState = "creating"
69

710
// StateCreated indicates that the runtime has finished the create operation
8-
StateCreated = "created"
11+
StateCreated ContainerState = "created"
912

1013
// StateRunning indicates that the container process has executed the
1114
// user-specified program but has not exited
12-
StateRunning = "running"
15+
StateRunning ContainerState = "running"
1316

1417
// StateStopped indicates that the container process has exited
15-
StateStopped = "stopped"
18+
StateStopped ContainerState = "stopped"
1619
)
1720

1821
// State holds information about the runtime state of the container.

0 commit comments

Comments
 (0)