diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-02-14 15:43:52 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-02-21 16:47:12 -0500 |
commit | c4dfbd58f5eb3851e031a5abfdbd9364e1779eb2 (patch) | |
tree | cab16fd90771afba7a8e4f6e8302cfbb90d9e7ce /libpod/runtime_ctr.go | |
parent | a746a61a171d514947dbd4db88541e3702647f2d (diff) | |
download | podman-c4dfbd58f5eb3851e031a5abfdbd9364e1779eb2.tar.gz podman-c4dfbd58f5eb3851e031a5abfdbd9364e1779eb2.tar.bz2 podman-c4dfbd58f5eb3851e031a5abfdbd9364e1779eb2.zip |
Don't log errors on removing volumes inuse, if container --volumes-from
When removing a container created with a --volumes-from a container
created with a built in volume, we complain if the original container
still exists. Since this is an expected state, we should not complain
about it.
Fixes: https://github.com/containers/podman/issues/12808
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 44364100e..aeea85f89 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -768,6 +768,14 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo continue } if err := runtime.removeVolume(ctx, volume, false, timeout); err != nil && errors.Cause(err) != define.ErrNoSuchVolume { + if errors.Cause(err) == define.ErrVolumeBeingUsed { + // Ignore error, since podman will report original error + volumesFrom, _ := c.volumesFrom() + if len(volumesFrom) > 0 { + logrus.Debugf("Cleanup volume not possible since volume is in use (%s)", v) + continue + } + } logrus.Errorf("Cleanup volume (%s): %v", v, err) } } |