Skip to content

Commit

Permalink
chore: use trivy code (#475)
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
  • Loading branch information
testwill committed Jan 20, 2024
1 parent 86dded1 commit 45e40f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/report/trivy.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (t *TrivyParser) Parse(file string) (*unversioned.UpdateManifest, error) {
result := trivyTypes.Result{}
for i := range report.Results {
r := &report.Results[i]
if r.Class == "os-pkgs" {
if r.Class == trivyTypes.ClassOSPkg {
if result.Class != "" {
return nil, errors.New("unexpected multiple results for os-pkgs")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/report/trivy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestParseTrivyReport(t *testing.T) {
Results: []trivyTypes.Result{
{
Target: "alpine:3.14.0 (alpine 3.14.0)",
Class: "os-pkgs",
Class: trivyTypes.ClassOSPkg,
Type: "alpine",
Vulnerabilities: []trivyTypes.DetectedVulnerability{
{
Expand Down

0 comments on commit 45e40f5

Please sign in to comment.