1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix container mount cleanup issues

- Refactor generic and path based cleanup functions into a single function.
- Include aufs and zfs mounts in the mounts cleanup.
- Containers that receive exit event on restore don't require manual cleanup.
- Make missing sandbox id message a warning because currently sandboxes are always cleared on startup. libnetwork#975
- Don't unmount volumes for containers that don't have base path. Shouldn't be needed after #21372

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2016-03-29 15:27:04 -07:00
parent 0dac544448
commit 05cc737f54
6 changed files with 35 additions and 73 deletions

View file

@ -59,7 +59,7 @@ func TestCleanupMounts(t *testing.T) {
return nil
}
d.cleanupMountsFromReader(strings.NewReader(mountsFixture), unmount)
d.cleanupMountsFromReaderByID(strings.NewReader(mountsFixture), "", unmount)
if unmounted != 1 {
t.Fatalf("Expected to unmount the shm (and the shm only)")
@ -97,7 +97,7 @@ func TestNotCleanupMounts(t *testing.T) {
return nil
}
mountInfo := `234 232 0:59 / /dev/shm rw,nosuid,nodev,noexec,relatime - tmpfs shm rw,size=65536k`
d.cleanupMountsFromReader(strings.NewReader(mountInfo), unmount)
d.cleanupMountsFromReaderByID(strings.NewReader(mountInfo), "", unmount)
if unmounted {
t.Fatalf("Expected not to clean up /dev/shm")
}