-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Trivy Analyzer has concurrent map write issue #1204
Comments
hi, I will fix this, and create PR soon |
I have implemented a solution and I'm ready to submit a PR if you approve.
|
Checklist
Affected Components
K8sGPT Version
No response
Kubernetes Version
No response
Host OS and its Version
No response
Steps to reproduce
k8sgpt integrations activate trivy
k8sgpt analyze
Then it failed with below error:
fatal error: concurrent map writes
fatal error: concurrent map writes
goroutine 48 [running]:
k8s.io/apimachinery/pkg/runtime.(*Scheme).AddKnownTypeWithName(0xc00056dd50, {{0x10a763d15, 0x16}, {0x10a7379e5, 0x8}, {0x10aff49c3, 0x1c}}, {0x10b91fcd0, 0xc0005741c0})
/Users/test/go/pkg/mod/k8s.io/[email protected]/pkg/runtime/scheme.go:174 +0x2eb
k8s.io/apimachinery/pkg/runtime.(*Scheme).AddKnownTypes(0xc00056dd50, {{0x10a763d15, 0x16}, {0x10a7379e5, 0x8}}, {0xc000eb3b40, 0x16, 0x16})
/Users/test/go/pkg/mod/k8s.io/[email protected]/pkg/runtime/scheme.go:148 +0x2af
github.com/aquasecurity/trivy-operator/pkg/apis/aquasecurity/v1alpha1.addKnownTypes(0xc00056dd50)
/Users/test/go/pkg/mod/github.com/aquasecurity/[email protected]/pkg/apis/aquasecurity/v1alpha1/register.go:22 +0x12b0
k8s.io/apimachinery/pkg/runtime.(*SchemeBuilder).AddToScheme(0x10d32c040, 0xc00056dd50)
/Users/test/go/pkg/mod/k8s.io/[email protected]/pkg/runtime/scheme_builder.go:29 +0x82
github.com/k8sgpt-ai/k8sgpt/pkg/integration/trivy.TrivyAnalyzer.analyzeVulnerabilityReports({0x1, 0x0}, {0xc00087d440, {0x10b9365d0, 0x10d3b4d88}, {0x0, 0x0}, {0x0, 0x0}, 0x0, ...})
/Users/test/A10/k8sgpt/pkg/integration/trivy/analyzer.go:43 +0x102
github.com/k8sgpt-ai/k8sgpt/pkg/integration/trivy.TrivyAnalyzer.Analyze({0x1, 0x0}, {0xc00087d440, {0x10b9365d0, 0x10d3b4d88}, {0x0, 0x0}, {0x0, 0x0}, 0x0, ...})
/Users/test/A10/k8sgpt/pkg/integration/trivy/analyzer.go:161 +0xbe
github.com/k8sgpt-ai/k8sgpt/pkg/analysis.(*Analysis).RunAnalysis.func3({0x10b903e80, 0xc000d2721a}, {0xc001494060, 0x13})
created by github.com/k8sgpt-ai/k8sgpt/pkg/analysis.(*Analysis).RunAnalysis in goroutine 1
/Users/test/A10/k8sgpt/pkg/analysis/analysis.go:269 +0xb74
Expected behaviour
no concurrent map write fatal error.
Actual behaviour
fatal error
Additional Information
No response
The text was updated successfully, but these errors were encountered: