From 484804abffda2692492e295d4691f90564d05eb2 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 7 Nov 2013 22:46:44 +0100 Subject: [PATCH] archive.ApplyLayer() remove files recursively Some aufs metadata are directories, and whiteouts can be for directories, so use os.RemoveAll() for these. --- archive/diff.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archive/diff.go b/archive/diff.go index 3154a44f36..38cbc3ed64 100644 --- a/archive/diff.go +++ b/archive/diff.go @@ -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 })