aboutsummaryrefslogtreecommitdiff
path: root/libpod/boltdb_state_internal.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2018-12-04 13:50:38 -0500
committerMatthew Heon <mheon@redhat.com>2018-12-04 13:58:51 -0500
commite3882cfa2d1329d44c8a580418ea1d56804b331d (patch)
tree92f8b48496db1339caf0a6fc2a7d3b621416cb76 /libpod/boltdb_state_internal.go
parent795fbba7695b03736acaf9abe75922404f5eea44 (diff)
downloadpodman-e3882cfa2d1329d44c8a580418ea1d56804b331d.tar.gz
podman-e3882cfa2d1329d44c8a580418ea1d56804b331d.tar.bz2
podman-e3882cfa2d1329d44c8a580418ea1d56804b331d.zip
Use runtime lockDir in BoltDB state
Instead of storing the runtime's file lock dir in the BoltDB state, refer to the runtime inside the Bolt state instead, and use the path stored in the runtime. This is necessary since we moved DB initialization very far up in runtime init, before the locks dir is properly initialized (and it must happen before the locks dir can be created, as we use the DB to retrieve the proper path for the locks dir now). Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/boltdb_state_internal.go')
-rw-r--r--libpod/boltdb_state_internal.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/boltdb_state_internal.go b/libpod/boltdb_state_internal.go
index 05536e069..3f00657ea 100644
--- a/libpod/boltdb_state_internal.go
+++ b/libpod/boltdb_state_internal.go
@@ -266,7 +266,7 @@ func (s *BoltState) getContainerFromDB(id []byte, ctr *Container, ctrsBkt *bolt.
}
// Get the lock
- lockPath := filepath.Join(s.lockDir, string(id))
+ lockPath := filepath.Join(s.runtime.lockDir, string(id))
lock, err := storage.GetLockfile(lockPath)
if err != nil {
return errors.Wrapf(err, "error retrieving lockfile for container %s", string(id))
@@ -302,7 +302,7 @@ func (s *BoltState) getPodFromDB(id []byte, pod *Pod, podBkt *bolt.Bucket) error
}
// Get the lock
- lockPath := filepath.Join(s.lockDir, string(id))
+ lockPath := filepath.Join(s.runtime.lockDir, string(id))
lock, err := storage.GetLockfile(lockPath)
if err != nil {
return errors.Wrapf(err, "error retrieving lockfile for pod %s", string(id))