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> Upstream-commit: 05cc737f5411a0effd299429140d031c4ad8dd05 Component: engine
This commit is contained in:
@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user