Add ownerReferences and subjects correlators to reduce false positives#258
Add ownerReferences and subjects correlators to reduce false positives#258mgonzalezo wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @mgonzalezo. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Thanks very much for the submission! I think to help solidify my understand of what cases this addresses, we could benefit from having a couple test cases that exemplify exactly what these new correlators accomplish. |
87a6766 to
07e50a3
Compare
|
Hi @lack , I have added integration test cases for ownerReferences and RBAC subjects correlators following the existing structure of this repo. These tests show the new correlators fix false positives:
These tests validate the fix for 4 false positives identified for telco-hub:
|
07e50a3 to
19b0634
Compare
|
@lack based on your feedback, I have updated the implementation to address both parts of validation check:
let me know what you think. |
|
/ok-to-test |
- Match resources via ownerReferences in cluster objects - Match ServiceAccounts via RBAC subjects in ClusterRoleBindings - Add Warnings array to JSON output for inferred resources - Fix golangci-lint issues (formatting and cyclomatic complexity) - Add test cases for both correlators
befe5d1 to
5e42626
Compare
|
@mgonzalezo: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Added two new correlators to reduce false positives when validating OpenShift Hub clusters:
OwnerReferenceCorrelator - Finds resources that exist as ownerReferences in cluster resources but not as standalone files. This handles operator-managed resources like ClusterLogForwarder and StorageCluster that are only referenced by their child resources.
SubjectsCorrelator - Finds ServiceAccounts and other subjects referenced in RBAC bindings but not present as standalone files in the collection.
PR raised after raising tickets OCPBUGS-69679 and TELCODOCS-2616 for OCP Hub cluster.