fix(kube-applier): add v1beta2-first CAPI adapter (ARO-30416) #8313
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.63) × (1 − Review Confidence (0.44)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 311 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.344
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #8313"
general
weight: 0.35
machi1990
ARO-30416
What
Add a kube-applier adapter that lists Cluster API resources through the management cluster’s Kubernetes API. It prefers
v1beta2and falls back tov1beta1only when the preferred endpoint is unserved. It returns the client used for the list so callers can update finalizers through the same API version.Why
Related to PR #7762, which introduces NamespaceDeletion. This PR adds the standalone CAPI adapter that #7762 can use for
v1beta2-first cleanup.NamespaceDeletion is the recovery path for stuck or orphaned hosted-cluster namespaces when normal HyperShift cleanup cannot finish. On management clusters that store CAPI resources as
v1beta2, writes through the deprecatedv1beta1endpoint require the HyperShift conversion webhook. If the webhook is unavailable, finalizer updates can stall cleanup. Using the storage version removes that conversion dependency for those updates.Testing
v1beta2preference,v1beta1fallback, same-version updates, pagination, and error propagation without fallback.go test ./kube-applier/...andgo build ./kube-applier/...passed locally.Special notes for your reviewer
This PR adds the adapter as a standalone change. The NamespaceDeletion cleanup path in PR #7762 needs to call the adapter and use the returned client for finalizer updates.
PR Checklist
/assigncommand