Explorar o código

Merge pull request #16852 from estesp/overlay-cleanup

Simplify dir removal in overlay driver
Alexander Morozov %!s(int64=9) %!d(string=hai) anos
pai
achega
6654b0e05f
Modificáronse 1 ficheiros con 1 adicións e 5 borrados
  1. 1 5
      daemon/graphdriver/overlay/overlay.go

+ 1 - 5
daemon/graphdriver/overlay/overlay.go

@@ -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.