Skip to content

Commit

Permalink
Fixes #18534: Skip non-standard moint FS for free-space check
Browse files Browse the repository at this point in the history
  • Loading branch information
ElaadF committed Nov 9, 2020
1 parent cd56dd0 commit dab3ecc
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,9 @@ final object CheckFreeSpace extends Check {

def run: IOResult[HealthcheckResult] = {
val file = root / "proc" / "mounts"
val mountsContent = file.lines.map(x => x.split(" ")(1)).toList
val mountsContent = file.lines.map(x => x.split(" ")(0)).toList

// We want to check `/var/*` if none exist take `/`
val partitionToCheck = {
val isParititionVar = mountsContent.filter(_.regionMatches(true, 0, "/var", 0, 4))
if (isParititionVar.isEmpty) List("/") else isParititionVar
}
val partitionToCheck = mountsContent.filter(_(0) == '/')

for {
paritionSpaceInfos <- IOResult.effect {
Expand Down

0 comments on commit dab3ecc

Please sign in to comment.