trivy-operator
trivy-operator copied to clipboard
chore: wait for a trivy server is running
What steps did you take and what happened: In client-server mode Trivy server needs some time to download the database. So Trivy-operator should wait for trivy server.
{"level":"error","ts":"2025-06-19T06:42:27Z","logger":"reconciler.scan job",
"msg":"Scan job container","job":"trivy-system/scan-vulnerabilityreport-64f467dd99",
"container":"k8s-cluster","status.reason":"Error",
"status.message":"2025-06-19T06:42:24Z\tFATAL\tFatal error\trun error: sbom scan error: scan error: scan failed: failed analysis: failed to store blob (sha256:03ce264e11efcf8e2965a6ec92ca582d8f3cfe6d2f7430628fa038bb9eb53c54) in cache: unable to store cache on the server: twirp error internal: failed to do request: Post \"http://trivy-service.trivy-system:4954/twirp/trivy.cache.v1.Cache/PutBlob\": dial tcp 10.100.250.46:4954: connect: connection refused\n","stacktrace":"github.com/aquasecurity/trivy-operator/pkg/vulnerabilityreport/controller.(*ScanJobController).completedContainers\n\t/Users/amf/aqua/my-trivy-operator/pkg/vulnerabilityreport/controller/scanjob.go:448\ngithub.com/aquasecurity/trivy-operator/pkg/vulnerabilityreport/controller.(*ScanJobController).SetupWithManager.(*ScanJobController).reconcileJobs.func1\n\t/Users/amf/aqua/my-trivy-operator/pkg/vulnerabilityreport/controller/scanjob.go:85\nsigs.k8s.io/controller-runtime/pkg/reconcile.TypedFunc[...].Reconcile\n\t/Users/amf/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/reconcile/reconcile.go:134\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile\n\t/Users/amf/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler\n\t/Users/amf/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:340\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem\n\t/Users/amf/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:300\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.1\n\t/Users/amf/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:202"}
Environment:
- Trivy-Operator version (use
trivy-operator version): 0.27.1 - Kubernetes version (use
kubectl version): 1.33 - OS (macOS 10.15, Windows 10, Ubuntu 19.10 etc): macOS 14.4 (23E214)
Hi, I am new to trivy-operator, can I take this issue?
hi @hhcs9527 sure go ahead!