diff --git a/pkg/executor/build.go b/pkg/executor/build.go index be1c6f9caf..754a1ad133 100644 --- a/pkg/executor/build.go +++ b/pkg/executor/build.go @@ -101,7 +101,7 @@ func newStageBuilder(args *dockerfile.BuildArgs, opts *config.KanikoOptions, sta return nil, err } - err = util.InitIgnoreList(true) + err = util.InitIgnoreList() if err != nil { return nil, errors.Wrap(err, "failed to initialize ignore list") } diff --git a/pkg/util/fs_util.go b/pkg/util/fs_util.go index 441e1b4142..8818207a60 100644 --- a/pkg/util/fs_util.go +++ b/pkg/util/fs_util.go @@ -143,7 +143,7 @@ func GetFSFromImage(root string, img v1.Image, extract ExtractFunction) ([]strin func GetFSFromLayers(root string, layers []v1.Layer, opts ...FSOpt) ([]string, error) { volumes = []string{} cfg := new(FSConfig) - if err := InitIgnoreList(true); err != nil { + if err := InitIgnoreList(); err != nil { return nil, errors.Wrap(err, "initializing filesystem ignore list") } logrus.Debugf("Ignore list: %v", ignorelist) @@ -1032,14 +1032,12 @@ func createParentDirectory(path string) error { // InitIgnoreList will initialize the ignore list using: // - defaultIgnoreList // - mounted paths via DetectFilesystemIgnoreList() -func InitIgnoreList(detectFilesystem bool) error { +func InitIgnoreList() error { logrus.Trace("Initializing ignore list") ignorelist = append([]IgnoreListEntry{}, defaultIgnoreList...) - if detectFilesystem { - if err := DetectFilesystemIgnoreList(config.MountInfoPath); err != nil { - return errors.Wrap(err, "checking filesystem mount paths for ignore list") - } + if err := DetectFilesystemIgnoreList(config.MountInfoPath); err != nil { + return errors.Wrap(err, "checking filesystem mount paths for ignore list") } return nil diff --git a/pkg/util/fs_util_test.go b/pkg/util/fs_util_test.go index ab784f3b6c..bd36dd7cc3 100644 --- a/pkg/util/fs_util_test.go +++ b/pkg/util/fs_util_test.go @@ -1502,7 +1502,7 @@ func TestInitIgnoreList(t *testing.T) { original := append([]IgnoreListEntry{}, ignorelist...) defer func() { ignorelist = original }() - err = InitIgnoreList(true) + err = InitIgnoreList() if err != nil { t.Fatal(err) }