mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2025-06-17 21:48:51 +00:00
Fix version check regexp.
This commit is contained in:
parent
c60c459bc4
commit
c93c94b3f6
@ -234,7 +234,7 @@ func getKubeVersion() string {
|
|||||||
subs := serverVersionRe.FindStringSubmatch(string(out))
|
subs := serverVersionRe.FindStringSubmatch(string(out))
|
||||||
if len(subs) == 2 {
|
if len(subs) == 2 {
|
||||||
ver = string(subs[1])
|
ver = string(subs[1])
|
||||||
validVersionPttn := `\d.\d`
|
validVersionPttn := `\d.\d.\d`
|
||||||
if matched, _ = regexp.MatchString(validVersionPttn, ver); !matched {
|
if matched, _ = regexp.MatchString(validVersionPttn, ver); !matched {
|
||||||
continueWithError(fmt.Errorf("%s: invalid server version ", ver), failmsg)
|
continueWithError(fmt.Errorf("%s: invalid server version ", ver), failmsg)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user