Rename containerRuntimeInfo to containerState for clarity

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
Matthew Heon
2018-01-18 11:49:14 -05:00
parent 4f2bf5ba1c
commit 49378c055a
5 changed files with 7 additions and 7 deletions

View File

@ -93,7 +93,7 @@ type Container struct {
runningSpec *spec.Spec
state *containerRuntimeInfo
state *containerState
// Locked indicates that a container has been locked as part of a
// Batch() operation
@ -109,9 +109,9 @@ type Container struct {
// TODO enable pod support
// TODO Add readonly support
// containerRuntimeInfo contains the current state of the container
// containerState contains the current state of the container
// It is stored on disk in a tmpfs and recreated on reboot
type containerRuntimeInfo struct {
type containerState struct {
// The current state of the running container
State ContainerStatus `json:"state"`
// The path to the JSON OCI runtime spec for this container

View File

@ -141,7 +141,7 @@ func newContainer(rspec *spec.Spec, lockDir string) (*Container, error) {
ctr := new(Container)
ctr.config = new(ContainerConfig)
ctr.state = new(containerRuntimeInfo)
ctr.state = new(containerState)
ctr.config.ID = stringid.GenerateNonCryptoID()
ctr.config.Name = namesgenerator.GetRandomName(0)

View File

@ -527,7 +527,7 @@ func (s *SQLState) UpdateContainer(ctr *Container) error {
return errors.Wrapf(err, "error parsing database state for container %s", ctr.ID())
}
newState := new(containerRuntimeInfo)
newState := new(containerState)
newState.State = ContainerStatus(state)
newState.ConfigPath = configPath
newState.RunDir = runDir

View File

@ -467,7 +467,7 @@ func (s *SQLState) ctrFromScannable(row scannable) (*Container, error) {
ctr := new(Container)
ctr.config = new(ContainerConfig)
ctr.state = new(containerRuntimeInfo)
ctr.state = new(containerState)
ctr.config.ID = id
ctr.config.Name = name

View File

@ -47,7 +47,7 @@ func getTestContainer(id, name, locksDir string) (*Container, error) {
},
},
},
state: &containerRuntimeInfo{
state: &containerState{
State: ContainerStateRunning,
ConfigPath: "/does/not/exist/specs/" + id,
RunDir: "/does/not/exist/tmp/",