1
0
mirror of https://github.com/k8sgpt-ai/k8sgpt.git synced 2025-05-13 18:44:57 +00:00

fix: respect namespace scope in trivy analyzer ()

Signed-off-by: Johannes Kleinlercher <johannes@kleinlercher.at>
This commit is contained in:
Johannes Kleinlercher 2023-09-15 22:30:59 +02:00 committed by GitHub
parent 0325724658
commit 6481590b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}