mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-22 10:09:36 +02:00
Fix fs_util tests failing on systems with /tmp mountpoint (#2583)
* Rename IgnoreListPath to MountInfoPath in config & constants The string points to /proc/self/mountinfo * fs_util_test.go: fix tests failing when /tmp mountpoint present The tests * Test_GetFSFromLayers_ignorelist * Test_GetFSFromLayers_with_whiteouts_include_whiteout_disabled * Test_GetFSFromLayers_with_whiteouts_include_whiteout_enabled were failing on systems with a /tmp mountpoint: fs_util.InitIgnoreList() adds all mountpoints to the ignore list, but the tests were expecting file operations in a /tmp subdirectory. This change provides an empty mountinfo list for the affected tests. Fixes #1779
This commit is contained in:
@@ -176,9 +176,9 @@ func setupMultistageTests(t *testing.T) (string, func()) {
|
||||
if err := ioutil.WriteFile(mFile, []byte(mountInfo), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
config.IgnoreListPath = mFile
|
||||
config.MountInfoPath = mFile
|
||||
return testDir, func() {
|
||||
config.RootDir = constants.RootDir
|
||||
config.IgnoreListPath = constants.IgnoreListPath
|
||||
config.MountInfoPath = constants.MountInfoPath
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user