diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-23 03:26:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 03:26:59 -0500 |
commit | 8b2432422fc188e15130c888a05e41fd881b8ca4 (patch) | |
tree | 403f0337bd61a09a10e05762e0935cc9bf0ad0d0 /libpod/runtime_ctr.go | |
parent | ccb96a2791fe9ae58a697bf1715600ecec8b246b (diff) | |
parent | c4dfbd58f5eb3851e031a5abfdbd9364e1779eb2 (diff) | |
download | podman-8b2432422fc188e15130c888a05e41fd881b8ca4.tar.gz podman-8b2432422fc188e15130c888a05e41fd881b8ca4.tar.bz2 podman-8b2432422fc188e15130c888a05e41fd881b8ca4.zip |
Merge pull request #13232 from rhatdan/volumes
Don't log errors on removing volumes inuse, if container --volumes-from
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 0fdcc8255..fc1a688fb 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -762,6 +762,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) } } |