Add ability to update container status from runc

Wire this in to all state-bound container operations to ensure
syncronization of container state.

Also exposes PID of running containers via API.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #56
Approved by: rhatdan
This commit is contained in:
Matthew Heon
2017-11-21 13:44:22 -05:00
committed by Atomic Bot
parent 7b736e3333
commit 8e76ebcf6e
6 changed files with 197 additions and 60 deletions

View File

@ -91,12 +91,8 @@ func (r *Runtime) RemoveContainer(c *Container, force bool) error {
return ErrRuntimeStopped
}
if !c.valid {
return ErrCtrRemoved
}
// Update the container to get current state
if err := r.state.UpdateContainer(c); err != nil {
if err := c.syncContainer(); err != nil {
return err
}
@ -225,9 +221,3 @@ func (r *Runtime) removeMultipleContainers(containers []storage.Container) error
}
return nil
}
// ContainerConfigToDisk saves a container's nonvolatile configuration to disk
// remove nolint when implemented
func (r *Runtime) containerConfigToDisk(ctr *Container) error { //nolint
return ErrNotImplemented
}