Skip to content

Commit

Permalink
Revert "save snaphots to tmp dir (#1662)" (#1670)
Browse files Browse the repository at this point in the history
This reverts commit 754253d.
  • Loading branch information
tejal29 authored Jun 14, 2021
1 parent 754253d commit 094fe52
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions pkg/config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ 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
}
3 changes: 0 additions & 3 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ 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"
Expand Down
4 changes: 2 additions & 2 deletions pkg/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.TempDir, "")
f, err := ioutil.TempFile(config.KanikoDir, "")
if err != nil {
return "", err
}
Expand Down Expand Up @@ -143,7 +143,7 @@ func (s *Snapshotter) TakeSnapshotFS() (string, error) {

func (s *Snapshotter) getSnashotPathPrefix() string {
if snapshotPathPrefix == "" {
return config.TempDir
return config.KanikoDir
}
return snapshotPathPrefix
}
Expand Down

0 comments on commit 094fe52

Please sign in to comment.