summaryrefslogtreecommitdiff
path: root/libpod/boltdb_state_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-06 13:48:33 +0200
committerGitHub <noreply@github.com>2019-09-06 13:48:33 +0200
commit0d8a22496e3c7e3d44251bdbac194c55de141e2c (patch)
treec3591e9470b5b90842e6764b71b3e3988bc8fab5 /libpod/boltdb_state_internal.go
parenta4572c4f681ef23495495f313ae513d5ba3fd495 (diff)
parentde9a394fcff19ae4422a3f65502c8790787351fd (diff)
downloadpodman-0d8a22496e3c7e3d44251bdbac194c55de141e2c.tar.gz
podman-0d8a22496e3c7e3d44251bdbac194c55de141e2c.tar.bz2
podman-0d8a22496e3c7e3d44251bdbac194c55de141e2c.zip
Merge pull request #3931 from mheon/volumes_with_options
Add support for mounting volumes with local driver and options
Diffstat (limited to 'libpod/boltdb_state_internal.go')
-rw-r--r--libpod/boltdb_state_internal.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/boltdb_state_internal.go b/libpod/boltdb_state_internal.go
index 6e4179835..a50fce31e 100644
--- a/libpod/boltdb_state_internal.go
+++ b/libpod/boltdb_state_internal.go
@@ -449,6 +449,14 @@ func (s *BoltState) getVolumeFromDB(name []byte, volume *Volume, volBkt *bolt.Bu
return errors.Wrapf(err, "error unmarshalling volume %s config from DB", string(name))
}
+ // Volume state is allowed to be nil for legacy compatibility
+ volStateBytes := volDB.Get(stateKey)
+ if volStateBytes != nil {
+ if err := json.Unmarshal(volStateBytes, volume.state); err != nil {
+ return errors.Wrapf(err, "error unmarshalling volume %s state from DB", string(name))
+ }
+ }
+
// Get the lock
lock, err := s.runtime.lockManager.RetrieveLock(volume.config.LockID)
if err != nil {