mirror of
https://github.com/containers/podman.git
synced 2025-10-19 20:23:08 +08:00
Fix various integration test issues with SQLite state
Two main changes: - The transient state tests relied on BoltDB paths, change to make them agnostic - The volume code in SQLite wasn't retrieving and setting the volume plugin for volumes that used one. Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
@ -295,6 +295,21 @@ func finalizeVolumeSqlite(vol *Volume) error {
|
||||
}
|
||||
vol.lock = lock
|
||||
|
||||
// Retrieve volume driver
|
||||
if vol.UsesVolumeDriver() {
|
||||
plugin, err := vol.runtime.getVolumePlugin(vol.config)
|
||||
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", vol.Name(), vol.config.Driver, err)
|
||||
} else {
|
||||
vol.plugin = plugin
|
||||
}
|
||||
}
|
||||
|
||||
vol.valid = true
|
||||
|
||||
return nil
|
||||
@ -513,7 +528,7 @@ func (s *SQLiteState) networkModify(ctr *Container, network string, opts types.P
|
||||
|
||||
_, ok := newCfg.Networks[network]
|
||||
if new && ok {
|
||||
return fmt.Errorf("container %s is already connected to network %s: %w", ctr.ID(), network, define.ErrNoSuchNetwork)
|
||||
return fmt.Errorf("container %s is already connected to network %s: %w", ctr.ID(), network, define.ErrNetworkConnected)
|
||||
}
|
||||
if !ok && (!new || disconnect) {
|
||||
return fmt.Errorf("container %s is not connected to network %s: %w", ctr.ID(), network, define.ErrNoSuchNetwork)
|
||||
|
Reference in New Issue
Block a user