mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2025-05-05 16:39:21 +00:00
fix: Add default case to CIS benchmark version selection (#1823)
This commit adds a default case to the switch statements for both "rancher" and "rke2" platforms. This ensures that a fallback CIS benchmark version ("rke-cis-1.7" and "rke2-cis-1.7" respectively) is returned when the Kubernetes version does not match any of the explicitly defined cases.
This commit is contained in:
parent
7f2f0f3227
commit
b0cb472482
@ -527,6 +527,8 @@ func getPlatformBenchmarkVersion(platform Platform) string {
|
|||||||
return "rke-cis-1.24"
|
return "rke-cis-1.24"
|
||||||
case "1.25", "1.26", "1.27":
|
case "1.25", "1.26", "1.27":
|
||||||
return "rke-cis-1.7"
|
return "rke-cis-1.7"
|
||||||
|
default:
|
||||||
|
return "rke-cis-1.7"
|
||||||
}
|
}
|
||||||
case "rke2r":
|
case "rke2r":
|
||||||
switch platform.Version {
|
switch platform.Version {
|
||||||
@ -536,6 +538,8 @@ func getPlatformBenchmarkVersion(platform Platform) string {
|
|||||||
return "rke2-cis-1.24"
|
return "rke2-cis-1.24"
|
||||||
case "1.25", "1.26", "1.27":
|
case "1.25", "1.26", "1.27":
|
||||||
return "rke2-cis-1.7"
|
return "rke2-cis-1.7"
|
||||||
|
default:
|
||||||
|
return "rke2-cis-1.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
Loading…
Reference in New Issue
Block a user