trivy-operator icon indicating copy to clipboard operation
trivy-operator copied to clipboard

Use indexes to lookup related resources more efficiently

Open erikgb opened this issue 3 years ago • 1 comments

I notice that trivy-operator has quite a few internal use cases for looking up related resources, where owners/dependents as the most common one. I suggest to use controller-runtime indexes to make these lookups more efficient and precise. That should also some existing TODOs in the code base. Example: https://github.com/aquasecurity/trivy-operator/blob/6916d7b1476cc50638a7d3f66822cfa96ad92b4e/pkg/vulnerabilityreport/controller.go#L214

An example for how this might look like code-wise: https://book.kubebuilder.io/cronjob-tutorial/controller-implementation.html#setup

erikgb avatar Jul 21 '22 10:07 erikgb

This suggestion makes a lot of sense. I can help review if needed. Thanks for looking into this!

JAORMX avatar Jul 21 '22 10:07 JAORMX

This issue is stale because it has been labeled with inactivity.

github-actions[bot] avatar Nov 21 '22 00:11 github-actions[bot]