Skip to content

Commit 1c09d35

Browse files
jyf111Wine93
authored andcommitted
Fix(precheck): support recognize kernel version like "3.15.0_.*".
Signed-off-by: jyf111 <[email protected]>
1 parent 0138432 commit 1c09d35

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

internal/task/task/checker/kernel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import (
4242

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

4848
func calcKernelVersion(version string) int {

internal/task/task/checker/kernel_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func TestCheckKernelVersion(t *testing.T) {
3939
}{
4040
{"5.12.0", nil},
4141
{"4.9.65-netease", nil},
42+
{"4.18.0_80.7.1.el8_0_bch_v1.0", nil},
4243
{"4.19.0-16-amd64", nil},
4344
{"3.15.0", nil},
4445
{"3.15.0.0.", errno.ERR_UNRECOGNIZED_KERNEL_VERSION},

0 commit comments

Comments
 (0)