Refresh pods when refreshing podman state

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

Closes: #784
Approved by: rhatdan
This commit is contained in:
Matthew Heon 2018-05-16 14:58:46 -04:00 committed by Atomic Bot
parent 7e1ea9d26d
commit 18f9e8d94f
1 changed files with 10 additions and 1 deletions

View File

@ -524,16 +524,25 @@ func (r *Runtime) refresh(alivePath string) error {
}
// Next refresh the state of all containers to recreate dirs and
// namespaces
// namespaces, and all the pods to recreate cgroups
ctrs, err := r.state.AllContainers()
if err != nil {
return errors.Wrapf(err, "error retrieving all containers from state")
}
pods, err := r.state.AllPods()
if err != nil {
return errors.Wrapf(err, "error retrieving all pods from state")
}
for _, ctr := range ctrs {
if err := ctr.refresh(); err != nil {
return err
}
}
for _, pod := range pods {
if err := pod.refresh(); err != nil {
return err
}
}
// Create a file indicating the runtime is alive and ready
file, err := os.OpenFile(alivePath, os.O_RDONLY|os.O_CREATE, 0644)