Skip to content

Commit

Permalink
Merge pull request #306 from jyf111/fix-kernel-version
Browse files Browse the repository at this point in the history
[fix] add support for recognizing kernel versions like "3.15.0_.*"
  • Loading branch information
caoxianfei1 authored Aug 31, 2023
2 parents b1c5562 + df9eea9 commit dbe508e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/task/task/checker/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (

const (
CHUNKSERVER_LEAST_KERNEL_VERSION = "3.15.0"
REGEX_KERNEL_VAERSION = "^(\\d+\\.\\d+\\.\\d+)(-.+)?$"
REGEX_KERNEL_VAERSION = "^(\\d+\\.\\d+\\.\\d+)(?:[-_].+)?$"
)

func calcKernelVersion(version string) int {
Expand Down
1 change: 1 addition & 0 deletions internal/task/task/checker/kernel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func TestCheckKernelVersion(t *testing.T) {
}{
{"5.12.0", nil},
{"4.9.65-netease", nil},
{"4.18.0_80.7.1.el8_0_bch_v1.0", nil},
{"4.19.0-16-amd64", nil},
{"3.15.0", nil},
{"3.15.0.0.", errno.ERR_UNRECOGNIZED_KERNEL_VERSION},
Expand Down

0 comments on commit dbe508e

Please sign in to comment.