Fix tmp folder deletion

Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 5cea9a0aa557401447d440ce2286be19f8fe3cc2
Component: engine
This commit is contained in:
Darren Stahl
2017-04-17 13:09:40 -07:00
parent 59735a2883
commit 1053121285
+1 -1
View File
@@ -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)