save snaphots to tmp dir (#1662)
This commit is contained in:
parent
04fb2fd55e
commit
754253d375
|
|
@ -22,10 +22,12 @@ import (
|
|||
|
||||
var RootDir string
|
||||
var KanikoDir string
|
||||
var TempDir string
|
||||
var IgnoreListPath string
|
||||
|
||||
func init() {
|
||||
RootDir = constants.RootDir
|
||||
KanikoDir = constants.KanikoDir
|
||||
TempDir = constants.TempDir
|
||||
IgnoreListPath = constants.IgnoreListPath
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ const (
|
|||
//KanikoDir is the path to the Kaniko directory
|
||||
KanikoDir = "/kaniko"
|
||||
|
||||
// TempDir is the path to the temp directory
|
||||
TempDir = "/kaniko/tmp"
|
||||
|
||||
IgnoreListPath = "/proc/self/mountinfo"
|
||||
|
||||
Author = "kaniko"
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ func (s *Snapshotter) Key() (string, error) {
|
|||
// TakeSnapshot takes a snapshot of the specified files, avoiding directories in the ignorelist, and creates
|
||||
// a tarball of the changed files. Return contents of the tarball, and whether or not any files were changed
|
||||
func (s *Snapshotter) TakeSnapshot(files []string, shdCheckDelete bool) (string, error) {
|
||||
f, err := ioutil.TempFile(config.KanikoDir, "")
|
||||
f, err := ioutil.TempFile(config.TempDir, "")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ func (s *Snapshotter) TakeSnapshotFS() (string, error) {
|
|||
|
||||
func (s *Snapshotter) getSnashotPathPrefix() string {
|
||||
if snapshotPathPrefix == "" {
|
||||
return config.KanikoDir
|
||||
return config.TempDir
|
||||
}
|
||||
return snapshotPathPrefix
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue