ROX-31227: Only allow scheduling equivalent TPs across clusters#19545
Draft
guzalv wants to merge 3 commits intomaster-base/gualvare/ROX-31227-add-tp-equivalence-hashfrom
Draft
Conversation
Contributor
Author
|
This change is part of the following stack:
Change managed by git-spice. |
This was referenced Mar 23, 2026
|
Skipping CI for Draft Pull Request. |
25a7a7e to
591e8b1
Compare
9 tasks
Contributor
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- There are unresolved merge conflict markers in central/complianceoperator/v2/compliancemanager/manager_impl.go (<<<<<<< HEAD / ======= / >>>>>>> …) that need to be resolved before merging.
- The tailored-profile equivalence logic is now implemented in both the datastore (resolveEligibleProfileNames/hash checks) and the manager (validateTailoredProfileHashConsistency), which risks future drift; consider centralizing this hash-consistency logic in a shared helper to keep behavior aligned.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- There are unresolved merge conflict markers in central/complianceoperator/v2/compliancemanager/manager_impl.go (<<<<<<< HEAD / ======= / >>>>>>> …) that need to be resolved before merging.
- The tailored-profile equivalence logic is now implemented in both the datastore (resolveEligibleProfileNames/hash checks) and the manager (validateTailoredProfileHashConsistency), which risks future drift; consider centralizing this hash-consistency logic in a shared helper to keep behavior aligned.
## Individual Comments
### Comment 1
<location path="central/complianceoperator/v2/compliancemanager/manager_impl.go" line_range="582-591" />
<code_context>
+<<<<<<< HEAD
</code_context>
<issue_to_address>
**issue (bug_risk):** Unresolved merge conflict markers must be resolved before merge
In this file, there are still `<<<<<<<`, `=======`, and `>>>>>>>` markers around the tailored profile validation logic. Select the correct version of the code, remove the markers, and ensure the file compiles before merging.
</issue_to_address>
### Comment 2
<location path="sensor/kubernetes/complianceoperator/dispatchers/complianceoperatortailoredprofiles.go" line_range="132-138" />
<code_context>
OperatorKind: central.ComplianceOperatorProfileV2_TAILORED_PROFILE,
}
+ var ruleNames []string
for _, rule := range protoProfile.GetRules() {
protoProfileV2.Rules = append(protoProfileV2.Rules, ¢ral.ComplianceOperatorProfileV2_Rule{RuleName: rule.GetName()})
+ ruleNames = append(ruleNames, rule.GetName())
}
+ protoProfileV2.EquivalenceHash = computeProfileEquivalenceHash(
+ tailoredProfile.GetName(),
+ tailoredProfile.GetNamespace(),
</code_context>
<issue_to_address>
**question (bug_risk):** Equivalence hash ignores some potentially relevant fields (e.g., values)
The hash currently covers only name, namespace, description, title, and rule names. If other fields (such as values/variables that influence rule evaluation) affect profile behavior, differences in those fields will be ignored. If tailored profile values are behaviorally significant, they should also be included in the hash so non-equivalent tailored profiles aren’t treated as equivalent across clusters.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
central/complianceoperator/v2/compliancemanager/manager_impl.go
Outdated
Show resolved
Hide resolved
sensor/kubernetes/complianceoperator/dispatchers/complianceoperatortailoredprofiles.go
Show resolved
Hide resolved
c921c4d to
f9bb406
Compare
591e8b1 to
7fac849
Compare
Contributor
|
Images are ready for the commit at e32a710. To use with deploy scripts, first |
9 tasks
7fac849 to
bc2fe41
Compare
bc2fe41 to
e32a710
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit was mostly generated by Claude Sonnet 4.6, after providing
it with a detailed implementation plan which was joint work between
human author and Claude Opus 4.6.
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Description
change me!
User-facing documentation
Testing and quality
Automated testing
How I validated my change
change me!