From 317b5ac3c76e31356110b9c743cdf186ce49e7db Mon Sep 17 00:00:00 2001 From: chenk Date: Tue, 9 Apr 2024 08:56:03 +0300 Subject: [PATCH] feat: support exclude/include kinds/namespaces (#327) Signed-off-by: chenk --- pkg/trivyk8s/trivyk8s.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/trivyk8s/trivyk8s.go b/pkg/trivyk8s/trivyk8s.go index 6a08c5e..6139e87 100644 --- a/pkg/trivyk8s/trivyk8s.go +++ b/pkg/trivyk8s/trivyk8s.go @@ -375,8 +375,9 @@ func (c *client) filterNamespaces(comp []bom.Component) []bom.Component { bm := make([]bom.Component, 0) for _, co := range comp { if FilterResources(c.GetIncludeNamespaces(), c.GetExcludeNamespaces(), co.Namespace) { - bm = append(bm, co) + continue } + bm = append(bm, co) } return bm }