fix(k8s): no error logged if trivy can't get docker image in kubernetes mode (#2521)

* Enable k8s logging and increase log level of the image scan errors

* Rework errors reporting

* Rework GetErrors method into printErrors

Print errors during report writing

* Increase log level for scan errors logging
This commit is contained in:
Denys Mazhar
2022-07-21 21:34:47 +03:00
committed by GitHub
parent e1e02d785f
commit 84677903a6
3 changed files with 19 additions and 1 deletions

View File

@@ -71,6 +71,7 @@ func run(ctx context.Context, opts flag.Options, cluster string, artifacts []*ar
if err != nil {
return xerrors.Errorf("k8s scan error: %w", err)
}
if err := report.Write(r, report.Option{
Format: opts.Format,
Report: opts.ReportFormat,