fix: errorlog future-vuls trivy-to-vuls (#1739)
Co-authored-by: 和田皓翔 <wadahiroka@192.168.0.6>
This commit is contained in:
@@ -42,7 +42,7 @@ func NewClient(token string, proxy string) *Client {
|
||||
func (f Client) UploadToFvuls(serverUUID string, groupID int64, tags []string, scanResultJSON []byte) error {
|
||||
var scanResult models.ScanResult
|
||||
if err := json.Unmarshal(scanResultJSON, &scanResult); err != nil {
|
||||
fmt.Printf("failed to parse json. err: %v\nPerhaps scan has failed. Please check following scan results.\nResult: %s", err, fmt.Sprintf("%s", scanResultJSON))
|
||||
fmt.Printf("failed to parse json. err: %v\nPerhaps scan has failed. Please check the scan results above or run trivy without pipes.\n", err)
|
||||
return err
|
||||
}
|
||||
scanResult.ServerUUID = serverUUID
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Package parser ...
|
||||
package parser
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
v2 "github.com/future-architect/vuls/contrib/trivy/parser/v2"
|
||||
"github.com/future-architect/vuls/models"
|
||||
@@ -23,7 +23,6 @@ type Report struct {
|
||||
func NewParser(vulnJSON []byte) (Parser, error) {
|
||||
r := Report{}
|
||||
if err := json.Unmarshal(vulnJSON, &r); err != nil {
|
||||
fmt.Printf("%s", fmt.Sprintf("%s", vulnJSON))
|
||||
return nil, xerrors.Errorf("Failed to parse JSON. Please use the latest version of trivy, trivy-to-vuls and future-vuls")
|
||||
}
|
||||
switch r.SchemaVersion {
|
||||
|
||||
Reference in New Issue
Block a user