profile-compaction: CollapseConfig CRD + projection overlay + user-ma…#808
profile-compaction: CollapseConfig CRD + projection overlay + user-ma…#808entlein wants to merge 1 commit into
Conversation
…naged lifecycle Signed-off-by: entlein <einentlein@gmail.com>
📝 WalkthroughWalkthroughThis PR extends container profile caching with tamper detection for user-supplied overlays, refactors projection to classify dynamic/wildcard patterns and support exec-arguments matching, adds overlay-identity stamping into cache checksums, and refactors rule-binding cache to dispatch notifications without holding locks. ChangesContainer Profile Cache: Tamper Detection, Overlay Identity, and Projection
Rule Binding Cache: Non-Blocking Notification Dispatch
Safety Fixes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/objectcache/containerprofilecache/containerprofilecache.go`:
- Around line 412-414: The verification calls to
c.verifyUserApplicationProfile(userAP, sharedData.Wlid) currently ignore its
boolean result; update both call sites (the one using userAP at lines ~412 and
the similar one around ~428-430) to check the returned bool and, when it is
false and the cache is running in strict verification mode (e.g., the instance
flag controlling strict verification such as c.strictVerify or equivalent),
avoid projecting/merging the overlay (skip the merge/projectOverlay path), log
the verification failure with context (Wlid and which overlay), and return or
surface an error instead of continuing; if not in strict mode, continue but log
a warning. Ensure you reference and use c.verifyUserApplicationProfile(...) and
the strict-mode flag when implementing the conditional.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: acff329b-9e89-4538-a272-7877e0ad1e70
📒 Files selected for processing (12)
pkg/objectcache/containerprofilecache/containerprofilecache.gopkg/objectcache/containerprofilecache/projection.gopkg/objectcache/containerprofilecache/projection_apply.gopkg/objectcache/containerprofilecache/tamper_alert.gopkg/objectcache/containerprofilecache/tamper_alert_test.gopkg/objectcache/containerprofilecache/test32_projection_test.gopkg/objectcache/projection_types.gopkg/objectcache/shared_container_data.gopkg/objectcache/v1/mock.gopkg/rulebindingmanager/cache/cache.gopkg/rulebindingmanager/cache/cache_test.gopkg/rulemanager/cel/libraries/cache/function_cache.go
| if userAP != nil { | ||
| c.verifyUserApplicationProfile(userAP, sharedData.Wlid) | ||
| } |
There was a problem hiding this comment.
Honor verification result before merging user overlays.
Line 413 and Line 429 call verification but ignore the boolean outcome. In strict mode, failed verification should prevent projecting that overlay; otherwise tampered/failed overlays are still merged.
Suggested fix
if userAP != nil {
- c.verifyUserApplicationProfile(userAP, sharedData.Wlid)
+ if !c.verifyUserApplicationProfile(userAP, sharedData.Wlid) {
+ userAP = nil
+ }
}
@@
if userNN != nil {
- c.verifyUserNetworkNeighborhood(userNN, sharedData.Wlid)
+ if !c.verifyUserNetworkNeighborhood(userNN, sharedData.Wlid) {
+ userNN = nil
+ }
}Also applies to: 428-430
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pkg/objectcache/containerprofilecache/containerprofilecache.go` around lines
412 - 414, The verification calls to c.verifyUserApplicationProfile(userAP,
sharedData.Wlid) currently ignore its boolean result; update both call sites
(the one using userAP at lines ~412 and the similar one around ~428-430) to
check the returned bool and, when it is false and the cache is running in strict
verification mode (e.g., the instance flag controlling strict verification such
as c.strictVerify or equivalent), avoid projecting/merging the overlay (skip the
merge/projectOverlay path), log the verification failure with context (Wlid and
which overlay), and return or surface an error instead of continuing; if not in
strict mode, continue but log a warning. Ensure you reference and use
c.verifyUserApplicationProfile(...) and the strict-mode flag when implementing
the conditional.
here things got confusing during the rebase, this is the sister PR to storage and need the signature PR (from matthyx)
Summary by CodeRabbit
New Features
Bug Fixes
Tests