Tolerate the lost+found directory in the data directory

This commit is contained in:
beorn7 2016-01-11 18:05:36 +01:00
parent 6293f3a374
commit add2ebdd56
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ func newPersistence(
if err != nil { if err != nil {
return nil, err return nil, err
} }
if len(fis) > 0 { if len(fis) > 0 && !(len(fis) == 1 && fis[0].Name() == "lost+found" && fis[0].IsDir()) {
return nil, fmt.Errorf("could not detect storage version on disk, assuming version 0, need version %d - please wipe storage or run a version of Prometheus compatible with storage version 0", Version) return nil, fmt.Errorf("could not detect storage version on disk, assuming version 0, need version %d - please wipe storage or run a version of Prometheus compatible with storage version 0", Version)
} }
// Finally we can write our own version into a new version file. // Finally we can write our own version into a new version file.