create list of build files

This commit is contained in:
Priya Wadhwa 2018-04-16 11:08:40 -07:00
parent c7bcc673fc
commit 52c5759fc4
No known key found for this signature in database
GPG Key ID: 0D0DAFD8F7AA73AE
2 changed files with 7 additions and 7 deletions

View File

@ -29,11 +29,6 @@ const (
//KanikoDir is the path to the Kaniko directory
KanikoDir = "/kaniko"
// KanikoExecutor is the path to the kaniko executor
KanikoExecutor = "/kaniko/executor"
// KanikoCerts is the path to the kaniko certs
KanikoCerts = "/kaniko/ssl/certs/ca-certificates.crt"
WhitelistPath = "/proc/self/mountinfo"
Author = "kaniko"
@ -52,3 +47,6 @@ const (
// NoBaseImage is the scratch image
NoBaseImage = "scratch"
)
// KanikoBuildFiles is the list of files required to build kaniko
var KanikoBuildFiles = []string{"/kaniko/executor", "/kaniko/ssl/certs/ca-certificates.crt"}

View File

@ -57,8 +57,10 @@ func ExtractFileSystemFromImage(img string) error {
// PathInWhitelist returns true if the path is whitelisted
func PathInWhitelist(path, directory string) bool {
if path == constants.KanikoExecutor || path == constants.KanikoCerts {
return false
for _, c := range constants.KanikoBuildFiles {
if path == c {
return false
}
}
for _, d := range whitelist {
dirPath := filepath.Join(directory, d)