← Back to Pull requests

Graduate customization CRDs to v1beta1 #897

Closed
unknown closed this pull request without merging on Oct 12, 2023 21:30 UTC
View on GitHub
unknown unknown commented on Oct 06, 2023 01:05 UTC
Author

Change description

<!--
Describe what this pull request does.

If your pull request is to address an open issue, indicate it by specifying the
issue number:

For example: "Fixes #858"

For Google internal contributors, you can specify an internal tracking ticket number:

For example: "Fixes b/302708148"

-->
- Add v1beta1 API, which is the same as the v1alpha1.
- Mark v1beta1 as the storage version.
- Mark v1alpha1 as not served version.

Tests you have done

<!--

Make sure you have run "make ready-pr" to run required tests and ensure this PR is ready to review.

Also if possible, share a bit more on the tests you have done.

For example if you have updated the pubsubtopic sample, you can share the test logs from running the test case locally.

go test -v -tags=integration ./config/tests/samples/create -test.run TestAll -run-tests pubsubtopic

-->

1. A fresh install of KCC v1.1110.0 (which has v1alpha1 customziation CRD)

$ git checkout v1.110.0

$ cd operator

$ git checkout upstream/master Makefile
(For convenience, we need newly added Makefile rules from HEAD)

$ make uninstall destroy

$ make install docker-build docker-push deploy

2. Create a CC object

$ k apply -f cc.yaml 
configconnector.core.cnrm.cloud.google.com/configconnector.core.cnrm.cloud.google.com created

3. Create v1alpha1 customization CRs

$ k apply -f config/samples/controller_resource_customization_sample.yaml 
controllerresource.customize.core.cnrm.cloud.google.com/cnrm-controller-manager created
controllerresource.customize.core.cnrm.cloud.google.com/cnrm-webhook-manager created

$ k get controllerresources
NAME                      AGE
cnrm-controller-manager   9s
cnrm-webhook-manager      9s

4. Verify the customization is applied

$ k get deployment cnrm-webhook-manager -n cnrm-system -o jsonpath='{range .spec.template.spec.containers[*]}[{.name}, {.resources}]{"\n"}{end}' 
[webhook, map[limits:map[memory:512Mi] requests:map[cpu:250m memory:256Mi]]]

$ k get pods -n cnrm-system (4 replicas for webhook manager pod)
NAME                                           READY   STATUS    RESTARTS   AGE
cnrm-controller-manager-0                      2/2     Running   0          20s
cnrm-deletiondefender-0                        1/1     Running   0          107s
cnrm-resource-stats-recorder-b766c4fd6-nskvr   2/2     Running   0          108s
cnrm-webhook-manager-d5887dc87-6npkj           1/1     Running   0          19s
cnrm-webhook-manager-d5887dc87-7wb4b           1/1     Running   0          11s
cnrm-webhook-manager-d5887dc87-t5gwz           1/1     Running   0          31s
cnrm-webhook-manager-d5887dc87-wpk92           1/1     Running   0          31s

5. Install operator and CRDs from this PR (This step mimics the KCC version upgrade)

$ git checkout v1beta1_customization_CRDs

$ make install docker-build docker-push deploy

6. Verify the previously created customization CRs still exist

$ k get controllerresources
Error from server (NotFound): Unable to list "customize.core.cnrm.cloud.google.com/v1alpha1, Resource=controllerresources": the server could not find the requested resource (get controllerresources.customize.core.cnrm.cloud.google.com)

$ k get controllerresources.customize.core.cnrm.cloud.google.com
NAME                      AGE
cnrm-controller-manager   4m46s
cnrm-webhook-manager      4m46s

7. Verify the customization is still effective

$ k get deployment cnrm-webhook-manager -n cnrm-system -o jsonpath='{range .spec.template.spec.containers[*]}[{.name}, {.resources}]{"\n"}{end}' 
[webhook, map[limits:map[memory:512Mi] requests:map[cpu:250m memory:256Mi]]]

$ k get pods -n cnrm-system
NAME                                           READY   STATUS    RESTARTS   AGE
cnrm-controller-manager-0                      2/2     Running   0          4m41s
cnrm-deletiondefender-0                        1/1     Running   0          6m8s
cnrm-resource-stats-recorder-b766c4fd6-nskvr   2/2     Running   0          6m9s
cnrm-webhook-manager-d5887dc87-6npkj           1/1     Running   0          4m40s
cnrm-webhook-manager-d5887dc87-7wb4b           1/1     Running   0          4m32s
cnrm-webhook-manager-d5887dc87-t5gwz           1/1     Running   0          4m52s
cnrm-webhook-manager-d5887dc87-wpk92           1/1     Running   0          4m52s

8. The existing CRs can be read via v1beta1

$ k get -f config/samples/controller_resource_customization_sample.yaml
NAME                      AGE
cnrm-controller-manager   7m7s
cnrm-webhook-manager      7m7s

9. v1alpha1 is no longer served

$ git checkout v1.110.0

$ k get -f config/samples/controller_resource_customization_sample.yaml
unable to recognize "config/samples/controller_resource_customization_sample.yaml": no matches for kind "ControllerResource" in version "customize.core.cnrm.cloud.google.com/v1alpha1"
unable to recognize "config/samples/controller_resource_customization_sample.yaml": no matches for kind "ControllerResource" in version "customize.core.cnrm.cloud.google.com/v1alpha1"

Diff: 650 lines (+487 / -163) across 8 files Reviewer: apelisse Review duration: 9865m
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
0.52
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
56%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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 #897"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 56.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 52% (MEDIUM) · Higher = larger blast radius
52%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 56.8% · Lower = rushed or shallow review
56.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 22.5% · Safe to merge
22.5%