summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-22 12:43:56 +0000
committerGitHub <noreply@github.com>2020-09-22 12:43:56 +0000
commit141688cd6fedc02c2f267020095f0ceae15934f5 (patch)
tree547d066674e7aeb7e9c1c57a862a151258cb4826 /pkg
parentfffcc25d8dfab8c6059c229177286f462d909b8d (diff)
parent0f9a2735b74dac1ae506da1d0ed389bd215a89db (diff)
downloadpodman-141688cd6fedc02c2f267020095f0ceae15934f5.tar.gz
podman-141688cd6fedc02c2f267020095f0ceae15934f5.tar.bz2
podman-141688cd6fedc02c2f267020095f0ceae15934f5.zip
Merge pull request #7691 from rhatdan/mount
Fix podman image unmount to only report images unmounted
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/infra/abi/images.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index cc62c3f27..25c0c184f 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -191,6 +191,15 @@ func (ir *ImageEngine) Unmount(ctx context.Context, nameOrIDs []string, options
reports := []*entities.ImageUnmountReport{}
for _, img := range images {
report := entities.ImageUnmountReport{Id: img.ID()}
+ mounted, _, err := img.Mounted()
+ if err != nil {
+ // Errors will be caught in Unmount call below
+ // Default assumption to mounted
+ mounted = true
+ }
+ if !mounted {
+ continue
+ }
if err := img.Unmount(options.Force); err != nil {
if options.All && errors.Cause(err) == storage.ErrLayerNotMounted {
logrus.Debugf("Error umounting image %s, storage.ErrLayerNotMounted", img.ID())