refactor: rm bool param detectFilesystem in `InitIgnoreList` (#2843)
This commit is contained in:
parent
11f0de81f5
commit
401616bb38
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue