Skip to content

Commit

Permalink
[fix] add support for recognizing kernel versions like "3.15.0_.*"
Browse files Browse the repository at this point in the history
Signed-off-by: jyf111 <[email protected]>
  • Loading branch information
jyf111 committed Aug 30, 2023
1 parent 3b6b0a1 commit df9eea9
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 df9eea9

Please sign in to comment.