Closed dwertent closed 6 months ago
PR Description updated to latest commit (https://github.com/kubescape/kubevuln/commit/5c93fb9ccde92b4584f73864e3254b45a3bd603a)
π― Main theme: Bug fix in the ScanCVE function
π PR summary: This PR addresses a bug in the ScanCVE function in the scan.go file. It removes the variable cveRetrievedFromStorage
and the condition that checked this variable and sent an empty report if cveRetrievedFromStorage
was true and cvep.Content
was nil. It also removes the import statement for github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1
.
π Type of PR: Bug fix
π§ͺ Relevant tests added: No
β±οΈ Estimated effort to review [1-5]: 2, because the changes are straightforward and limited to one function in one file.
π Security concerns: No
π‘ General suggestions: The changes seem to be addressing the issue at hand. However, it would be beneficial to add tests to ensure that the changes do not introduce new bugs and that the function behaves as expected after the changes.
relevant file | core/services/scan.go |
suggestion |
Consider adding error handling for the case when |
relevant line | if cve.Content == nil { |
relevant file | core/services/scan.go |
suggestion |
It would be beneficial to add logging statements in the function to track the progress and to help with debugging in the future. [medium] |
relevant line | func (s *ScanService) ScanCVE(ctx context.Context) error { |
Summary:
Type
bug_fix
Description
This PR includes a bug fix in the
ScanCVE
function in thecore/services/scan.go
file. The main changes include:cveRetrievedFromStorage
variable which was used to check if the CVE was retrieved from storage.cveRetrievedFromStorage
was true andcvep.Content
was nil.github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1
.PR changes walkthrough
1 files
scan.go
core/services/scan.go
**The changes in this file are primarily focused on the
`ScanCVE` function. The variable `cveRetrievedFromStorage`
has been removed, which was previously used to check if the
CVE was retrieved from storage. The condition that checked
this variable and sent an empty report if
`cveRetrievedFromStorage` was true and `cvep.Content` was
nil has also been removed. The import statement for
`github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1`
has been removed as well.**
User description
Overview