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

archive.ApplyLayer() remove files recursively

Some aufs metadata are directories, and whiteouts can be for
directories, so use os.RemoveAll() for these.
This commit is contained in:
Alexander Larsson 2013-11-07 22:46:44 +01:00
parent 140da580d4
commit 484804abff

View file

@ -35,7 +35,7 @@ func ApplyLayer(dest string, layer Archive) error {
return err
} else if matched {
log.Printf("Removing aufs metadata %s", fullPath)
_ = os.Remove(fullPath)
_ = os.RemoveAll(fullPath)
}
filename := filepath.Base(path)
@ -47,7 +47,7 @@ func ApplyLayer(dest string, layer Archive) error {
_ = os.Remove(rmTargetPath)
// Remove the whiteout itself
log.Printf("Removing whiteout %s", fullPath)
_ = os.Remove(fullPath)
_ = os.RemoveAll(fullPath)
}
return nil
})