From 23ac909b2d2765791f8f201c9c8ca6f5900662d0 Mon Sep 17 00:00:00 2001 From: Tejal Desai Date: Wed, 6 May 2020 12:08:44 -0700 Subject: [PATCH] Revert "small perf optimizing. Only remove whiteout path if it needs to be included in the tar" This reverts commit 67db51810bca1b10281c4ada0e7340805bd4abd6. --- pkg/util/fs_util.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/util/fs_util.go b/pkg/util/fs_util.go index 230d87669..af553f8c9 100644 --- a/pkg/util/fs_util.go +++ b/pkg/util/fs_util.go @@ -161,15 +161,18 @@ func GetFSFromLayers(root string, layers []v1.Layer, opts ...FSOpt) ([]string, e dir := filepath.Dir(path) if strings.HasPrefix(base, ".wh.") { - if !cfg.includeWhiteout { - logrus.Debug("not including whiteout files") - continue - } logrus.Debugf("Whiting out %s", path) + name := strings.TrimPrefix(base, ".wh.") if err := os.RemoveAll(filepath.Join(dir, name)); err != nil { return nil, errors.Wrapf(err, "removing whiteout %s", hdr.Name) } + + if !cfg.includeWhiteout { + logrus.Debug("not including whiteout files") + continue + } + } if err := cfg.extractFunc(root, hdr, tr); err != nil {