From 094fe52b3746b6cd59c4c3669cf2f640647321cd Mon Sep 17 00:00:00 2001 From: Tejal Desai Date: Mon, 14 Jun 2021 12:09:07 -0700 Subject: [PATCH] Revert "save snaphots to tmp dir (#1662)" (#1670) This reverts commit 754253d37564fa913c9c6a2efab942920f9562fa. --- pkg/config/init.go | 2 -- pkg/constants/constants.go | 3 --- pkg/snapshot/snapshot.go | 4 ++-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/config/init.go b/pkg/config/init.go index 5b06b1abd..2e08b975c 100644 --- a/pkg/config/init.go +++ b/pkg/config/init.go @@ -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 } diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index e8de2c406..a1df904b4 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -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" diff --git a/pkg/snapshot/snapshot.go b/pkg/snapshot/snapshot.go index 43dbcf377..ed4888ed7 100644 --- a/pkg/snapshot/snapshot.go +++ b/pkg/snapshot/snapshot.go @@ -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 } @@ -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 }