From 35a58ceeed507defb59c4cc0afcb249de8bf93c5 Mon Sep 17 00:00:00 2001 From: simar7 <1254783+simar7@users.noreply.github.com> Date: Fri, 12 Jan 2024 11:05:45 -0700 Subject: [PATCH] fix(rego): Ignore case when scanning k8s subtype (#1516) --- pkg/rego/scanner.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/rego/scanner.go b/pkg/rego/scanner.go index 6e02dd7fe..53b33bb9c 100644 --- a/pkg/rego/scanner.go +++ b/pkg/rego/scanner.go @@ -296,11 +296,10 @@ func checkSubtype(ii map[string]interface{}, provider string, subTypes []SubType return true } } - case string: // k8s - // TODO(simar): This logic probably needs to be revisited - if services == st.Group || - services == st.Version || - services == st.Kind { + case string: // k8s - logic can be improved + if strings.EqualFold(services, st.Group) || + strings.EqualFold(services, st.Version) || + strings.EqualFold(services, st.Kind) { return true } }