allow snapshot of kaniko certs so kaniko can build kaniko

This commit is contained in:
Priya Wadhwa 2018-04-16 10:38:38 -07:00
parent 0ddc2115a5
commit c7bcc673fc
No known key found for this signature in database
GPG Key ID: 0D0DAFD8F7AA73AE
3 changed files with 4 additions and 5 deletions

View File

@ -100,10 +100,7 @@ func resolveSourceContext() error {
if srcContext == "" && bucket == "" {
return errors.New("please specify a path to the build context with the --context flag or a GCS bucket with the --bucket flag")
}
if srcContext != "" && bucket != "" {
return errors.New("please specify either --bucket or --context as the desired build context")
}
if srcContext != "" {
if bucket == "" {
return nil
}
logrus.Infof("Using GCS bucket %s as source context", bucket)

View File

@ -31,6 +31,8 @@ const (
// 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"

View File

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