archive.ApplyLayer() - handle directory whiteouts

When directories are white-outed we can get called with the previously
removed directories. Handle this with os.IsNotExist(error).
Upstream-commit: 6f3c32eb18f0a604ba2638b6a9f19f8824412fd1
Component: engine
This commit is contained in:
Alexander Larsson
2013-11-12 21:14:54 +01:00
parent 7c76e102e9
commit 82914826a6
+5
View File
@@ -20,6 +20,11 @@ func ApplyLayer(dest string, layer Archive) error {
// Step 2: walk for whiteouts and apply them, removing them in the process
err := filepath.Walk(dest, func(fullPath string, f os.FileInfo, err error) error {
if err != nil {
if os.IsNotExist(err) {
// This happens in the case of whiteouts in parent dir removing a directory
// We just ignore it
return filepath.SkipDir
}
return err
}