diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-05-16 14:58:46 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-17 23:10:12 +0000 |
commit | 18f9e8d94fcbfee4f0e89a9635e945a7082a7243 (patch) | |
tree | 77eb5357fd589e1c751cd90ea261fe71ba1a051e /libpod/runtime.go | |
parent | 7e1ea9d26dff92c346bb11640fdab523d513e867 (diff) | |
download | podman-18f9e8d94fcbfee4f0e89a9635e945a7082a7243.tar.gz podman-18f9e8d94fcbfee4f0e89a9635e945a7082a7243.tar.bz2 podman-18f9e8d94fcbfee4f0e89a9635e945a7082a7243.zip |
Refresh pods when refreshing podman state
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #784
Approved by: rhatdan
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 29011be10..5be0981ed 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -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) |