create list of build files
This commit is contained in:
parent
c7bcc673fc
commit
52c5759fc4
|
|
@ -29,11 +29,6 @@ const (
|
||||||
//KanikoDir is the path to the Kaniko directory
|
//KanikoDir is the path to the Kaniko directory
|
||||||
KanikoDir = "/kaniko"
|
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"
|
WhitelistPath = "/proc/self/mountinfo"
|
||||||
|
|
||||||
Author = "kaniko"
|
Author = "kaniko"
|
||||||
|
|
@ -52,3 +47,6 @@ const (
|
||||||
// NoBaseImage is the scratch image
|
// NoBaseImage is the scratch image
|
||||||
NoBaseImage = "scratch"
|
NoBaseImage = "scratch"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// KanikoBuildFiles is the list of files required to build kaniko
|
||||||
|
var KanikoBuildFiles = []string{"/kaniko/executor", "/kaniko/ssl/certs/ca-certificates.crt"}
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,11 @@ func ExtractFileSystemFromImage(img string) error {
|
||||||
|
|
||||||
// PathInWhitelist returns true if the path is whitelisted
|
// PathInWhitelist returns true if the path is whitelisted
|
||||||
func PathInWhitelist(path, directory string) bool {
|
func PathInWhitelist(path, directory string) bool {
|
||||||
if path == constants.KanikoExecutor || path == constants.KanikoCerts {
|
for _, c := range constants.KanikoBuildFiles {
|
||||||
|
if path == c {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for _, d := range whitelist {
|
for _, d := range whitelist {
|
||||||
dirPath := filepath.Join(directory, d)
|
dirPath := filepath.Join(directory, d)
|
||||||
if pkgutil.HasFilepathPrefix(path, dirPath) {
|
if pkgutil.HasFilepathPrefix(path, dirPath) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue