summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-12-07 13:15:34 -0500
committerMatthew Heon <matthew.heon@gmail.com>2017-12-07 13:15:34 -0500
commitb71cde19c8b511c054ee42084113ce97ed6d5b62 (patch)
treec69fc6b6a6ad1d931c059ad2325ca7778b8ba4e8 /libpod/runtime.go
parentb66287689a0c8c9f2f8c01cdca065fb1f6e8d872 (diff)
downloadpodman-b71cde19c8b511c054ee42084113ce97ed6d5b62.tar.gz
podman-b71cde19c8b511c054ee42084113ce97ed6d5b62.tar.bz2
podman-b71cde19c8b511c054ee42084113ce97ed6d5b62.zip
Add ability to refresh state in DB
Also, ensure we always recreate runtime spec so our net namespace paths will be correct Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 103faf3f8..36225bf69 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -273,7 +273,13 @@ func (r *Runtime) Shutdown(force bool) error {
// Refreshes the state, recreating temporary files
// Does not check validity as the runtime is not valid until after this has run
func (r *Runtime) refresh(alivePath string) error {
- // We need to refresh the state of all containers
+ // First clear the state in the database
+ if err := r.state.Refresh(); err != nil {
+ return err
+ }
+
+ // Next refresh the state of all containers to recreate dirs and
+ // namespaces
ctrs, err := r.state.AllContainers()
if err != nil {
return errors.Wrapf(err, "error retrieving all containers from state")