diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-14 21:56:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 21:56:37 -0500 |
commit | 8ce9995951b14a0a4d7252cdd97597411fd5f980 (patch) | |
tree | b59fcfdfc29ff3979186116e23373c8d72f31169 /libpod/boltdb_state_internal.go | |
parent | 2b7793b6121d336a285fb7b9a7612c221cbf63d2 (diff) | |
parent | f781efd2dca4c1db54762c6edec2b915e48dd5d8 (diff) | |
download | podman-8ce9995951b14a0a4d7252cdd97597411fd5f980.tar.gz podman-8ce9995951b14a0a4d7252cdd97597411fd5f980.tar.bz2 podman-8ce9995951b14a0a4d7252cdd97597411fd5f980.zip |
Merge pull request #8604 from mheon/volume_plugin_impl
Initial implementation of volume plugins
Diffstat (limited to 'libpod/boltdb_state_internal.go')
-rw-r--r-- | libpod/boltdb_state_internal.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libpod/boltdb_state_internal.go b/libpod/boltdb_state_internal.go index c06fedd3e..6014fbef3 100644 --- a/libpod/boltdb_state_internal.go +++ b/libpod/boltdb_state_internal.go @@ -497,6 +497,21 @@ func (s *BoltState) getVolumeFromDB(name []byte, volume *Volume, volBkt *bolt.Bu } } + // Retrieve volume driver + if volume.UsesVolumeDriver() { + plugin, err := s.runtime.getVolumePlugin(volume.config.Driver) + if err != nil { + // We want to fail gracefully here, to ensure that we + // can still remove volumes even if their plugin is + // missing. Otherwise, we end up with volumes that + // cannot even be retrieved from the database and will + // cause things like `volume ls` to fail. + logrus.Errorf("Volume %s uses volume plugin %s, but it cannot be accessed - some functionality may not be available: %v", volume.Name(), volume.config.Driver, err) + } else { + volume.plugin = plugin + } + } + // Get the lock lock, err := s.runtime.lockManager.RetrieveLock(volume.config.LockID) if err != nil { |