:bug: crd: do not add versions for same-named non-object types #1482
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.39) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 136 lines diff across 1 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.294
Real PR Conversation Timeline
1 comments
"Review active on #1482"
general
weight: 0.35
KR-Ravindra
Problem
When a kind is an object in one version of a group and a plain struct with the same name exists in another version,
NeedCRDForadds both as CRD versions. It looks the kind up by name in every package of the group without checking that the type there is an object.Fix
NeedCRDFornow keeps only the versions where the type embedsmetav1.TypeMetaandmetav1.ObjectMeta. The check goes throughgo/types, so a version that aliases the object from another version still counts. If no version has an object type it behaves as before, since some tests callNeedCRDFordirectly on plain types.How tested
I added cbandy's reproducer from the issue to the
multiple_versionstestdata, plus a test that theBarCRD only getsv1beta2. On main it fails with["v1beta1", "v1beta2"]; with this change it passes.go test ./pkg/...andmake lintpass.Fixes #1137
Prepared with an AI agent operated by KR-Ravindra, who reviewed and tested it. The agent is pointed only at issues maintainers have confirmed and problems he has hit, not at producing contributions.