Repository navigation
refactor(storage): add ListContainerProfiles to ProfileClient - #1005
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 39 minutes. View limit detailsLimit details: You鈥檝e used the included review currently available. Review configuration: 鈿欙笍 Run configuration
馃搾 Files selected for processing (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Performance Benchmark ResultsNode-Agent Resource Usage
Dedup EffectivenessNo data available. |
There was a problem hiding this comment.
Copilot review overview
馃煛 Changes recommended
The mock silently accepts invalid selectors and does not implement cluster-wide namespace listing consistently with the real client.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds namespace-aware, label-filterable ContainerProfile listing to the storage abstraction and its test implementations.
Changes:
- Extends
ProfileClientwithListContainerProfiles. - Implements listing for real and mock storage clients.
- Updates tests and cache test doubles for interface compatibility.
| File | Description |
|---|---|
pkg/鈥媠torage/鈥媣1/鈥媍ontainerprofile.go |
Delegates profile listing to the typed storage client. |
pkg/鈥媠torage/鈥媠torage_mock.go |
Adds in-memory namespace and label filtering. |
pkg/鈥媠torage/鈥媠torage_mock_test.go |
Tests mock listing and filtering. |
pkg/鈥媠torage/鈥媠torage_interface.go |
Extends the profile client interface. |
pkg/鈥媜bjectcache/鈥媍ontainerprofilecache/鈥媟econciler_test.go |
Updates profile-client test doubles. |
pkg/鈥媜bjectcache/鈥媍ontainerprofilecache/鈥媟econciler_notfound_test.go |
Updates scripted test client. |
pkg/鈥媜bjectcache/鈥媍ontainerprofilecache/鈥媟econciler_checksum_test.go |
Updates checksum-related test clients. |
pkg/鈥媜bjectcache/鈥媍ontainerprofilecache/鈥媔ntegration_helpers_test.go |
Updates integration storage stub. |
pkg/鈥媜bjectcache/鈥媍ontainerprofilecache/鈥媓ost_shared_data_test.go |
Updates signaling test client. |
pkg/鈥媜bjectcache/鈥媍ontainerprofilecache/鈥媍ontainerprofilecache_test.go |
Updates shared fake profile client. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
- propagate label selector parse errors in StorageHttpClientMock.ListContainerProfiles - preserve metav1.NamespaceAll cluster-wide listing behavior Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
4b7a2ee to
4f9f395
Compare
Performance Benchmark ResultsNode-Agent Resource Usage
Dedup EffectivenessNo data available. |

Description
Adds
ListContainerProfiles(ctx context.Context, namespace string, opts metav1.ListOptions) (*v1beta1.ContainerProfileList, error)to thestorage.ProfileClientinterface, implemented on*storage.Storageand*storage.StorageHttpClientMock.Value & Context
In subsequent phases (signed bundles and suggester), container profiles may be split into fragments or queried by labels (such as
signature.kubescape.io/bundle=<name>). AddingListContainerProfilestoProfileClientprepares this extension point across the storage layer and cache mocks with full label-selector filtering support.Testing
TestStorageHttpClientMock_ListContainerProfilescovering namespace and label selector filtering.storage.ProfileClientacrosspkg/objectcache/containerprofilecache.go test ./pkg/storage/... ./pkg/objectcache/...).