Merge pull request #34983 from thaJeztah/suppress-tmp-rename-warning

Suppress warning for renaming missing tmp directory
This commit is contained in:
Sebastiaan van Stijn 2017-09-26 16:53:28 +02:00 committed by GitHub
commit 6523459721

View file

@ -1044,7 +1044,7 @@ func prepareTempDir(rootDir string, rootIDs idtools.IDPair) (string, error) {
logrus.Warnf("failed to delete old tmp directory: %s", newName)
}
}()
} else {
} else if !os.IsNotExist(err) {
logrus.Warnf("failed to rename %s for background deletion: %s. Deleting synchronously", tmpDir, err)
if err := os.RemoveAll(tmpDir); err != nil {
logrus.Warnf("failed to delete old tmp directory: %s", tmpDir)