[ARO-28373] Initial implementation of ClusterResourcesController #6070
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6070"
general
weight: 0.35
nimrodshn
https://redhat.atlassian.net/browse/ARO-28373
What
An initial implementation of a
ClusterResourcesControllerwhich polls the newly created/resourcesendpoint and creates anApplyDesiredocument for each resource recieved.Why
This is part of the deprecation of ACM's
Manifestworkas well as the entireMaestropipeline for the newkube-appliercomponent.For more information see here.
Important subtelty concerning deletion:
Since the list of desired resources is a simple list the controller applies blindly the number of ApplyDesire docs may grow without limit. To resolve this we have added a simple mechanism to ensure only the _current_ received resources are to be applied and whatever remains ("stale resources") are to be removed:
The ApplyDesire deletion happens in two paths:
1. ClusterResourcesController cleanup (
deleteStaleApplyDesiresmethod inClusterResourcesController):While the cluster is running, if a resource disappears from the Cluster Service response (e.g., a nodepool's resources are removed), this function cleans up the corresponding ApplyDesires. It only touches desires tagged clusterresource (our controller's) and uses a two-phase approach: first marks the desire as
Type=Deleteso kube-applier removes the Kubernetes object, then purges the Cosmos document once theReadDesireconfirms the object is gone.2. Cluster deletion (
deleteAllOwnedApplyDesiresinClusterResourcesController)When a cluster is being fully deleted, this function lists ALL
ApplyDesiresfor the cluster and deletes them directly from Cosmos - no tag filtering, no two-phase.Testing
Testing is required for feature completion and tests should be part of the pull
request along with the feature changes.
How was this tested?
- Observed the deletion of the resource from the resources list.
- Observed the deletion of the ApplyDesire and ReadDesire for it.
- Deleted the cluster observed the deletion of ApplyDesires.
UT were Added.
Special notes for your reviewer
Important: This is a work in progress for visibility and debugging.
PR Checklist
If E2E tests are included:
demonstrate that the test is able to detect a defect/error and fail with
proper error message and logs which communicates nature of the problem.