chore: update trivy from 0.23.0 to 0.24.02 (#1407)

* chore: update trivy from 0.23.0 to 0.24.2

* chore: deal with changing structs

see: 11f4f81123
This commit is contained in:
Satoru Nihei
2022-03-04 16:00:08 +09:00
committed by GitHub
parent 2f05864813
commit ec31c54caf
4 changed files with 257 additions and 105 deletions

View File

@@ -4,7 +4,7 @@ import (
"encoding/json"
"time"
"github.com/aquasecurity/trivy/pkg/report"
"github.com/aquasecurity/trivy/pkg/types"
"golang.org/x/xerrors"
"github.com/future-architect/vuls/constant"
@@ -18,7 +18,7 @@ type ParserV2 struct {
// Parse trivy's JSON and convert to the Vuls struct
func (p ParserV2) Parse(vulnJSON []byte) (result *models.ScanResult, err error) {
var report report.Report
var report types.Report
if err = json.Unmarshal(vulnJSON, &report); err != nil {
return nil, err
}
@@ -34,7 +34,7 @@ func (p ParserV2) Parse(vulnJSON []byte) (result *models.ScanResult, err error)
return scanResult, nil
}
func setScanResultMeta(scanResult *models.ScanResult, report *report.Report) error {
func setScanResultMeta(scanResult *models.ScanResult, report *types.Report) error {
const trivyTarget = "trivy-target"
for _, r := range report.Results {
if pkg.IsTrivySupportedOS(r.Type) {