mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-19 03:11:17 +02:00
Fix a bug in volume handling for multi-stage images. (#554)
We were previously not resetting the whitelist between stages, this caused issues with volumes.
This commit is contained in:
+4
-1
@@ -42,7 +42,7 @@ type WhitelistEntry struct {
|
||||
PrefixMatchOnly bool
|
||||
}
|
||||
|
||||
var whitelist = []WhitelistEntry{
|
||||
var initialWhitelist = []WhitelistEntry{
|
||||
{
|
||||
Path: "/kaniko",
|
||||
PrefixMatchOnly: false,
|
||||
@@ -62,6 +62,8 @@ var whitelist = []WhitelistEntry{
|
||||
},
|
||||
}
|
||||
|
||||
var whitelist = initialWhitelist
|
||||
|
||||
var excluded []string
|
||||
|
||||
// GetFSFromImage extracts the layers of img to root
|
||||
@@ -328,6 +330,7 @@ func checkWhitelistRoot(root string) bool {
|
||||
// Where (5) is the mount point relative to the process's root
|
||||
// From: https://www.kernel.org/doc/Documentation/filesystems/proc.txt
|
||||
func DetectFilesystemWhitelist(path string) error {
|
||||
whitelist = initialWhitelist
|
||||
f, err := os.Open(path)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user