feat(cache): support server-side user-managed profile merge configurations#831
feat(cache): support server-side user-managed profile merge configurations#831yugal07 wants to merge 1 commit into
Conversation
…tion Signed-off-by: yugal07 <yashsadhwani544@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR adds a feature flag to conditionally skip redundant client-side user-managed ( ChangesServer-Side User-Managed Merge
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
I will make the relevant changes once storage 319 is deployed. Let me know when |
Overview
Adds a
ServerSideUserManagedMergeconfiguration flag (profileProjection.serverSideUserManagedMergeEnabled, defaultfalse) that lets node-agent skip its client-side user-managed (ug-)ApplicationProfile/NetworkNeighborhoodfetch + projection and rely on the storage backend serving the already-mergedContainerProfileon GET (kubescape/storage#319).Current behavior: node-agent always fetches
ug-<workload>AP/NN by their well-known name and projects them on top of the consolidatedContainerProfile, in bothtryPopulateEntryand the reconciler refresh path. This duplicates work that storage#319 now performs server-side, resulting in two extra GETs per container populate/refresh cycle.New behavior: when the flag is enabled, node-agent performs no
ug-GETs and no client-sideug-projection. The user-managed overlay is received transparently via the mergedContainerProfilereturned byGetContainerProfile.The flag is disabled by default and should only be enabled once a storage version containing
kubescape/storage#319is confirmed to be deployed.Additional Information
ug-fetch sites.userManagedAP/userManagedNNasnilallows the downstream projection pass, resource-version bookkeeping, overlay metrics, synthetic-CP fallback, and reconciler RV fast-skip logic to become natural no-ops without introducing flag checks throughout the projection pipeline.UserDefinedProfileMetadataKey) remains unchanged. This is a separate client-side feature and is not covered by storage#319.ug-path. Existing behavior remains the default, and cleanup can be deferred until the flag is eventually flipped.ContainerProfilesvia GET, the merged view is always observed. A code comment near the CP GET documents this dependency for future maintainers.kubescape/helm-chartsexposesprofileProjection.serverSideUserManagedMergeEnabledthrough the node-agent ConfigMap (separate PR, defaultfalse).How to Test
go test ./pkg/objectcache/containerprofilecache/... ./pkg/config/... -count=1Covered test cases
TestServerSideMerge_SkipsUgFetchug-AP/NN GETs are performed.ContainerProfile.TestServerSideMerge_RefreshSkipsUgRefetchug-re-fetches when the flag is enabled.TestServerSideMerge_LabelOverlayStillAppliesTestClientSideMerge_DefaultFetchesUgug-profiles.Related Issues / PRs
Note: not yet in a storage release; the flag must stay default-off until a
storage release containing feat(processor): merge ug- AP/NN into consolidated ContainerProfile storage#319 is deployed.
Checklist before requesting a review
Summary by CodeRabbit
New Features
Tests