mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
fix(cve): Search by CVE title/id (full or partial) when listing an image's CVEs (#1264)
Signed-off-by: Ana-Roberta Lisca <ana.kagome@yahoo.com>
This commit is contained in:
committed by
GitHub
parent
4d0bbf1e00
commit
eea6f3f85a
@@ -9,7 +9,7 @@ import (
|
||||
type CveInfoMock struct {
|
||||
GetImageListForCVEFn func(repo, cveID string) ([]common.TagInfo, error)
|
||||
GetImageListWithCVEFixedFn func(repo, cveID string) ([]common.TagInfo, error)
|
||||
GetCVEListForImageFn func(repo string, reference string, pageInput cveinfo.PageInput,
|
||||
GetCVEListForImageFn func(repo string, reference string, searchedCVE string, pageInput cveinfo.PageInput,
|
||||
) ([]cvemodel.CVE, cveinfo.PageInfo, error)
|
||||
GetCVESummaryForImageFn func(repo string, reference string,
|
||||
) (cveinfo.ImageCVESummary, error)
|
||||
@@ -33,13 +33,15 @@ func (cveInfo CveInfoMock) GetImageListWithCVEFixed(repo, cveID string) ([]commo
|
||||
return []common.TagInfo{}, nil
|
||||
}
|
||||
|
||||
func (cveInfo CveInfoMock) GetCVEListForImage(repo string, reference string, pageInput cveinfo.PageInput) (
|
||||
func (cveInfo CveInfoMock) GetCVEListForImage(repo string, reference string,
|
||||
searchedCVE string, pageInput cveinfo.PageInput,
|
||||
) (
|
||||
[]cvemodel.CVE,
|
||||
cveinfo.PageInfo,
|
||||
error,
|
||||
) {
|
||||
if cveInfo.GetCVEListForImageFn != nil {
|
||||
return cveInfo.GetCVEListForImageFn(repo, reference, pageInput)
|
||||
return cveInfo.GetCVEListForImageFn(repo, reference, searchedCVE, pageInput)
|
||||
}
|
||||
|
||||
return []cvemodel.CVE{}, cveinfo.PageInfo{}, nil
|
||||
|
||||
Reference in New Issue
Block a user