trivy-operator: trivy-operator - error: json: cannot unmarshal number into Go value of type trivy.ScanReport

What steps did you take and what happened:

Installed trivy-operator 0.0.8 via helm on k8s v1.19.8. Ran:

kubectl logs -n trivy-system deployment/trivy-operator 

and observed the following in the log:

“stacktrace”: “sigs.k8s.io/controller-runtime/pkg/interna/controller.(*Controller).processNextWorkItem\n\t/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.1/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/interna/controller.(*Controller).Start.func2.2\n\t/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.1/pkg/internal/controller/controller.go:234”

What did you expect to happen:

I expected to see vulnerability reports when running:

kubectl get vulnerabilityreports --all-namespaces -o wide

Anything else you would like to add:

I do see that vulnerability reports (scan jobs) run successfully and report vulns in the logs, however I am unable to retrieve them with the aforementioned kubectl command

Environment:

  • Trivy-Operator version 0.0.8
  • Kubernetes version 1.19.8:

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (11 by maintainers)

Most upvoted comments

I can confirm that it works with the v0.1.0 release. Thanks a lot! 👍

This can be used as a workaround to overcome this issue, but the better option would be to temporarily saved it on Filesystem (fs) to avoid the interruption.

@VF-mbrauer thank you for checking it. I have open an item #422 for long term solution

Hi @chen-keinan as already explained in chat, the environment is open to the internet to download the DB. Also, a lot of images are OK to be scanned, even with results. It is just about some specific images where scans gets stuck.

@ollide there was a bug with client-server mode #190 which we fixed and to be released later on today with trivy-operator v0.1.0