Merge pull request #16852 from estesp/overlay-cleanup

Simplify dir removal in overlay driver
Upstream-commit: 6654b0e05f663da394bac6ed846187bca90451f5
Component: engine
This commit is contained in:
Alexander Morozov
2015-10-08 08:44:50 -07:00

View File

@ -306,11 +306,7 @@ func (d *Driver) dir(id string) string {
// Remove cleans the directories that are created for this id.
func (d *Driver) Remove(id string) error {
dir := d.dir(id)
if _, err := os.Stat(dir); err != nil {
return err
}
return os.RemoveAll(dir)
return os.RemoveAll(d.dir(id))
}
// Get creates and mounts the required file system for the given id and returns the mount path.