rmTargetPath can be a directory, so we have to use RemoveAll() or we
will fail to whiteout non-empty directories.
| ... | ... |
@@ -49,7 +49,7 @@ func ApplyLayer(dest string, layer Archive) error {
|
| 49 | 49 |
rmTargetPath := filepath.Join(filepath.Dir(fullPath), rmTargetName) |
| 50 | 50 |
// Remove the file targeted by the whiteout |
| 51 | 51 |
log.Printf("Removing whiteout target %s", rmTargetPath)
|
| 52 |
- _ = os.Remove(rmTargetPath) |
|
| 52 |
+ _ = os.RemoveAll(rmTargetPath) |
|
| 53 | 53 |
// Remove the whiteout itself |
| 54 | 54 |
log.Printf("Removing whiteout %s", fullPath)
|
| 55 | 55 |
_ = os.RemoveAll(fullPath) |