perf(controller): tune nodescan controller cache#1234
Conversation
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
There was a problem hiding this comment.
Pull request overview
This PR optimizes the controller-runtime cache configuration for node-scanning mode by stripping unneeded fields from cached Node and NodeSBOM objects, reducing memory usage in line with Issue #1177.
Changes:
- Added a
TransformStripNodecache transform to retain only node OS/architecture (plus metadata) while clearingSpec, most ofStatus, and managed fields. - Added unit tests covering the new node transform behavior.
- Enabled per-object cache transforms (and disabled deep-copy for read-only access) for
NodeandNodeSBOMwhencfg.NodeScanis enabled.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/controller/transform.go | Adds TransformStripNode to strip Node objects down to OS/arch + minimal metadata for cache efficiency. |
| internal/controller/transform_test.go | Adds unit test validating the node transform removes expected fields while preserving OS/arch and key metadata. |
| cmd/controller/main.go | Enables cache transforms for Node and NodeSBOM in node-scan mode and disables deep-copy for read-only cache access. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1234 +/- ##
==========================================
- Coverage 53.44% 49.87% -3.57%
==========================================
Files 61 77 +16
Lines 5340 6498 +1158
==========================================
+ Hits 2854 3241 +387
- Misses 2088 2801 +713
- Partials 398 456 +58
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
alegrey91
left a comment
There was a problem hiding this comment.
LGTM. Please suppress the golangci-lint error before merging it.
Description
Fixes #1177