Skip to content

Commit

Permalink
archive.ApplyLayer() remove files recursively
Browse files Browse the repository at this point in the history
Some aufs metadata are directories, and whiteouts can be for
directories, so use os.RemoveAll() for these.
  • Loading branch information
alexlarsson committed Nov 7, 2013
1 parent 140da58 commit 484804a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions archive/diff.go
Expand Up @@ -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)
Expand All @@ -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
})
Expand Down

0 comments on commit 484804a

Please sign in to comment.