1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2024-12-22 22:58:07 +00:00

Add strings.ToLower ...

This commit is contained in:
Philippe ALEXANDRE 2018-05-15 11:52:49 +02:00
parent c4e7487ba7
commit 7b61cf60fe

View File

@ -80,6 +80,7 @@ func (t *testItem) execute(s string) (result bool) {
switch t.Compare.Op { switch t.Compare.Op {
case "eq": case "eq":
value := strings.ToLower(flagVal)
// Do case insensitive comparaison for booleans ... // Do case insensitive comparaison for booleans ...
if value == "false" || value == "true" { if value == "false" || value == "true" {
result = value == t.Compare.Value result = value == t.Compare.Value
@ -88,6 +89,7 @@ func (t *testItem) execute(s string) (result bool) {
} }
case "noteq": case "noteq":
value := strings.ToLower(flagVal)
// Do case insensitive comparaison for booleans ... // Do case insensitive comparaison for booleans ...
if value == "false" || value == "true" { if value == "false" || value == "true" {
result = !(value == t.Compare.Value) result = !(value == t.Compare.Value)