refactor: rm bool param detectFilesystem in InitIgnoreList (#2843)

This commit is contained in:
tal66
2023-11-14 20:10:44 -05:00
committed by GitHub
parent 11f0de81f5
commit 401616bb38
3 changed files with 6 additions and 8 deletions
+4 -6
View File
@@ -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
+1 -1
View File
@@ -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)
}