aboutsummaryrefslogtreecommitdiff
path: root/libpod/boltdb_state_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-23 14:41:55 +0200
committerGitHub <noreply@github.com>2022-09-23 14:41:55 +0200
commita80c406f833190070636c5982f5b0aff58f9b23d (patch)
treeb694fa3e2fe8e5d134b83ca64b4f6867987e2456 /libpod/boltdb_state_internal.go
parent0d65c2481973a956bb90e393814a18ceb6389450 (diff)
parentfc6dcd12b3430f2d1ee495ef19d184a088f3bb34 (diff)
downloadpodman-a80c406f833190070636c5982f5b0aff58f9b23d.tar.gz
podman-a80c406f833190070636c5982f5b0aff58f9b23d.tar.bz2
podman-a80c406f833190070636c5982f5b0aff58f9b23d.zip
Merge pull request #15841 from mheon/image_driver
Add support for 'image' volume driver
Diffstat (limited to 'libpod/boltdb_state_internal.go')
-rw-r--r--libpod/boltdb_state_internal.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/libpod/boltdb_state_internal.go b/libpod/boltdb_state_internal.go
index 87f1fa4eb..7f2d49b31 100644
--- a/libpod/boltdb_state_internal.go
+++ b/libpod/boltdb_state_internal.go
@@ -28,6 +28,7 @@ const (
execName = "exec"
aliasesName = "aliases"
runtimeConfigName = "runtime-config"
+ volumeCtrsName = "volume-ctrs"
exitCodeName = "exit-code"
exitCodeTimeStampName = "exit-code-time-stamp"
@@ -67,6 +68,7 @@ var (
dependenciesBkt = []byte(dependenciesName)
volDependenciesBkt = []byte(volCtrDependencies)
networksBkt = []byte(networksName)
+ volCtrsBkt = []byte(volumeCtrsName)
exitCodeBkt = []byte(exitCodeName)
exitCodeTimeStampBkt = []byte(exitCodeTimeStampName)
@@ -384,6 +386,14 @@ func getExitCodeTimeStampBucket(tx *bolt.Tx) (*bolt.Bucket, error) {
return bkt, nil
}
+func getVolumeContainersBucket(tx *bolt.Tx) (*bolt.Bucket, error) {
+ bkt := tx.Bucket(volCtrsBkt)
+ if bkt == nil {
+ return nil, fmt.Errorf("volume containers bucket not found in DB: %w", define.ErrDBBadConfig)
+ }
+ return bkt, nil
+}
+
func (s *BoltState) getContainerConfigFromDB(id []byte, config *ContainerConfig, ctrsBkt *bolt.Bucket) error {
ctrBkt := ctrsBkt.Bucket(id)
if ctrBkt == nil {
@@ -528,6 +538,9 @@ func (s *BoltState) getVolumeFromDB(name []byte, volume *Volume, volBkt *bolt.Bu
}
}
+ // Need this for UsesVolumeDriver() so set it now.
+ volume.runtime = s.runtime
+
// Retrieve volume driver
if volume.UsesVolumeDriver() {
plugin, err := s.runtime.getVolumePlugin(volume.config)
@@ -550,7 +563,6 @@ func (s *BoltState) getVolumeFromDB(name []byte, volume *Volume, volBkt *bolt.Bu
}
volume.lock = lock
- volume.runtime = s.runtime
volume.valid = true
return nil