Fix tmp folder deletion
Signed-off-by: Darren Stahl <darst@microsoft.com> Upstream-commit: 5cea9a0aa557401447d440ce2286be19f8fe3cc2 Component: engine
This commit is contained in:
@@ -955,7 +955,7 @@ func prepareTempDir(rootDir string, rootUID, rootGID int) (string, error) {
|
||||
if tmpDir = os.Getenv("DOCKER_TMPDIR"); tmpDir == "" {
|
||||
tmpDir = filepath.Join(rootDir, "tmp")
|
||||
newName := tmpDir + "-old"
|
||||
if err := os.Rename(tmpDir, newName); err != nil {
|
||||
if err := os.Rename(tmpDir, newName); err == nil {
|
||||
go func() {
|
||||
if err := os.RemoveAll(newName); err != nil {
|
||||
logrus.Warnf("failed to delete old tmp directory: %s", newName)
|
||||
|
||||
Reference in New Issue
Block a user