mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 15:37:50 -08:00
feat(report): output plugin (#4863)
Signed-off-by: knqyf263 <knqyf263@gmail.com> Co-authored-by: DmitriyLewen <dmitriy.lewen@smartforce.io>
This commit is contained in:
@@ -91,7 +91,7 @@ type Runner interface {
|
||||
// Filter filter a report
|
||||
Filter(ctx context.Context, opts flag.Options, report types.Report) (types.Report, error)
|
||||
// Report a writes a report
|
||||
Report(opts flag.Options, report types.Report) error
|
||||
Report(ctx context.Context, opts flag.Options, report types.Report) error
|
||||
// Close closes runner
|
||||
Close(ctx context.Context) error
|
||||
}
|
||||
@@ -280,8 +280,8 @@ func (r *runner) Filter(ctx context.Context, opts flag.Options, report types.Rep
|
||||
return report, nil
|
||||
}
|
||||
|
||||
func (r *runner) Report(opts flag.Options, report types.Report) error {
|
||||
if err := pkgReport.Write(report, opts); err != nil {
|
||||
func (r *runner) Report(ctx context.Context, opts flag.Options, report types.Report) error {
|
||||
if err := pkgReport.Write(ctx, report, opts); err != nil {
|
||||
return xerrors.Errorf("unable to write results: %w", err)
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ func Run(ctx context.Context, opts flag.Options, targetKind TargetKind) (err err
|
||||
return xerrors.Errorf("filter error: %w", err)
|
||||
}
|
||||
|
||||
if err = r.Report(opts, report); err != nil {
|
||||
if err = r.Report(ctx, opts, report); err != nil {
|
||||
return xerrors.Errorf("report error: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user