From 6481590b29b80391ea1c9298cae5d8f0a4ae7354 Mon Sep 17 00:00:00 2001 From: Johannes Kleinlercher Date: Fri, 15 Sep 2023 22:30:59 +0200 Subject: [PATCH] fix: respect namespace scope in trivy analyzer (#661) Signed-off-by: Johannes Kleinlercher --- pkg/integration/trivy/analyzer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/integration/trivy/analyzer.go b/pkg/integration/trivy/analyzer.go index 07a1050b3e..f8c2e21e78 100644 --- a/pkg/integration/trivy/analyzer.go +++ b/pkg/integration/trivy/analyzer.go @@ -42,7 +42,7 @@ func (TrivyAnalyzer) analyzeVulnerabilityReports(a common.Analyzer) ([]common.Re if err != nil { return nil, err } - err = restClient.Get().Resource("vulnerabilityreports").Do(a.Context).Into(result) + err = restClient.Get().Resource("vulnerabilityreports").Namespace(a.Namespace).Do(a.Context).Into(result) if err != nil { return nil, err } @@ -103,7 +103,7 @@ func (t TrivyAnalyzer) analyzeConfigAuditReports(a common.Analyzer) ([]common.Re if err != nil { return nil, err } - err = restClient.Get().Resource("configauditreports").Do(a.Context).Into(result) + err = restClient.Get().Resource("configauditreports").Namespace(a.Namespace).Do(a.Context).Into(result) if err != nil { return nil, err }