summaryrefslogtreecommitdiff
path: root/libpod/runtime_pod_linux.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-06-23 15:59:58 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-06-23 18:36:30 +0200
commit2fab7d169b0714574b6620f454c1408bf8097d4f (patch)
tree38fee38929cab3c38a321597f49b5de6e86618ca /libpod/runtime_pod_linux.go
parent6e8953abfc4693937c73e22ca6eddebf909d4d93 (diff)
downloadpodman-2fab7d169b0714574b6620f454c1408bf8097d4f.tar.gz
podman-2fab7d169b0714574b6620f454c1408bf8097d4f.tar.bz2
podman-2fab7d169b0714574b6620f454c1408bf8097d4f.zip
add podman volume reload to sync volume plugins
Libpod requires that all volumes are stored in the libpod db. Because volume plugins can be created outside of podman, it will not show all available plugins. This podman volume reload command allows users to sync the libpod db with their external volume plugins. All new volumes from the plugin are also created in the libpod db and when a volume from the db no longer exists it will be removed if possible. There are some problems: - naming conflicts, in this case we only use the first volume we found. This is not deterministic. - race conditions, we have no control over the volume plugins. It is possible that the volumes changed while we run this command. Fixes #14207 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r--libpod/runtime_pod_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go
index dcc3a044f..fc55a2bc2 100644
--- a/libpod/runtime_pod_linux.go
+++ b/libpod/runtime_pod_linux.go
@@ -301,7 +301,7 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool,
if !volume.Anonymous() {
continue
}
- if err := r.removeVolume(ctx, volume, false, timeout); err != nil {
+ if err := r.removeVolume(ctx, volume, false, timeout, false); err != nil {
if errors.Cause(err) == define.ErrNoSuchVolume || errors.Cause(err) == define.ErrVolumeRemoved {
continue
}