mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix "no such file or directory" warning when unmounting IPC mount
When cleaning up IPC mounts, the daemon could log a warning if the IPC mount was not found; ``` cleanup: failed to unmount IPC: umount /var/lib/docker/containers/90f408e26e205d30676655a08504dddc0d17f5713c1dd4654cf67ded7d3bbb63/mounts/shm, flags: 0x2: no such file or directory" ``` These warnings are safe to ignore, but can cause some confusion; `container.UnmountIpcMount()` already attempted to suppress these warnings, however, `mount.Unmount()` returns a `mountError`, which nests the original error, therefore detecting failed. This parch uses `errors.Cause()` to get the _underlying_ error to detect if it's a "is not exist". Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
4e83c90ae8
commit
060f387c0b
1 changed files with 1 additions and 1 deletions
|
@ -190,7 +190,7 @@ func (container *Container) UnmountIpcMount() error {
|
||||||
if shmPath == "" {
|
if shmPath == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err = mount.Unmount(shmPath); err != nil && !os.IsNotExist(err) {
|
if err = mount.Unmount(shmPath); err != nil && !os.IsNotExist(errors.Cause(err)) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue