diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-07-18 13:47:08 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@gmail.com> | 2018-07-24 16:12:31 -0400 |
commit | 572fd75d226550ac1576bf38812e5417a9eddeee (patch) | |
tree | 954db9068e06d808b97915e4e5c6a041fd6d1cfc /libpod/boltdb_state.go | |
parent | 92e6bd01a8623a61e37217155508856eb2be3316 (diff) | |
download | podman-572fd75d226550ac1576bf38812e5417a9eddeee.tar.gz podman-572fd75d226550ac1576bf38812e5417a9eddeee.tar.bz2 podman-572fd75d226550ac1576bf38812e5417a9eddeee.zip |
Add tests for state namespacing
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/boltdb_state.go')
-rw-r--r-- | libpod/boltdb_state.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libpod/boltdb_state.go b/libpod/boltdb_state.go index 470201348..b2a246ca8 100644 --- a/libpod/boltdb_state.go +++ b/libpod/boltdb_state.go @@ -8,6 +8,7 @@ import ( "github.com/boltdb/bolt" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // BoltState is a state implementation backed by a Bolt DB @@ -29,6 +30,8 @@ func NewBoltState(path, lockDir string, runtime *Runtime) (State, error) { state.namespace = "" state.namespaceBytes = nil + logrus.Debugf("Initializing boltdb state at %s", path) + // Make the directory that will hold container lockfiles if err := os.MkdirAll(lockDir, 0750); err != nil { // The directory is allowed to exist @@ -367,10 +370,10 @@ func (s *BoltState) HasContainer(id string) (bool, error) { return err } - ctrExists := ctrBucket.Bucket(ctrID) - if ctrExists != nil { + ctrDB := ctrBucket.Bucket(ctrID) + if ctrDB != nil { if s.namespaceBytes != nil { - nsBytes := ctrBucket.Get(namespaceKey) + nsBytes := ctrDB.Get(namespaceKey) if bytes.Equal(nsBytes, s.namespaceBytes) { exists = true } |