diff --git a/lib/snapshot/mem_fs_test.go b/lib/snapshot/mem_fs_test.go index 1eb9573..9c91cda 100644 --- a/lib/snapshot/mem_fs_test.go +++ b/lib/snapshot/mem_fs_test.go @@ -303,7 +303,7 @@ func TestUpdateMemFS(t *testing.T) { require.Equal(os.ErrNotExist, err) }) - t.Run("WhiteoutNonexistentCausesError", func(t *testing.T) { + t.Run("WhiteoutNonexistentNotCausingError", func(t *testing.T) { require := require.New(t) tmpRoot, err := ioutil.TempDir("/tmp", "makisu-test") @@ -333,7 +333,7 @@ func TestUpdateMemFS(t *testing.T) { require.NoError(addDirectoryToLayer(l2, tmpRoot, dst21, 0755)) dst22 := "/test11/.wh.test13" require.NoError(addDirectoryToLayer(l2, tmpRoot, dst22, 0755)) - require.Error(fs.merge(l2)) + require.NoError(fs.merge(l2)) }) } diff --git a/lib/snapshot/mem_layer.go b/lib/snapshot/mem_layer.go index 66ea789..96a14e4 100644 --- a/lib/snapshot/mem_layer.go +++ b/lib/snapshot/mem_layer.go @@ -23,6 +23,7 @@ import ( "sort" "strings" + "github.com/uber/makisu/lib/log" "github.com/uber/makisu/lib/pathutils" "github.com/uber/makisu/lib/tario" ) @@ -114,7 +115,9 @@ func (f *whiteoutMemFile) updateMemFS(node *memFSNode) error { if i != len(parts)-1 { return fmt.Errorf("missing intermediate dir %s in %s", part, f.del) } - return fmt.Errorf("whiteout nonexistent path %s", f.del) + // This could happen to files that's cleaned up in the background, like + // python package's .dist-info or .pth file. + log.Warnf("Trying to whiteout nonexistent path: %s", f.del) } } return nil