Skip to content

Commit

Permalink
Fix tail newline on thp check (#1005)
Browse files Browse the repository at this point in the history
Introduced by #964

There is a newline at the end of output of cat command,
so the '[never]' check will fail on the empty newline.
  • Loading branch information
lucklove committed Dec 31, 2020
1 parent 8dd0cb5 commit 0de52d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cluster/operation/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ func CheckTHP(e executor.Executor) *CheckResult {
return result
}

for _, line := range strings.Split(string(stdout), "\n") {
for _, line := range strings.Split(strings.Trim(string(stdout), "\n"), "\n") {
if !strings.Contains(line, "[never]") {
result.Err = fmt.Errorf("THP is enabled, please disable it for best performance")
return result
Expand Down

0 comments on commit 0de52d5

Please sign in to comment.