Merge pull request #32669 from darrenstahlmsft/FixTmpDelete
Fix tmp deletion Upstream-commit: 64932563c91eccec589c02c788a179799fbe5ac6 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