Match all served resource.k8s.io versions in the ResourceSlice policy #35
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 291 lines diff across 3 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.340
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #35"
general
weight: 0.35
troychiu
What type of PR is this?
/kind bug
What this PR does / why we need it:
The ValidatingAdmissionPolicy that restricts ResourceSlice writes to the owning node listed only the beta API versions (
v1beta1andv1beta2). On clusters servingresource.k8s.io/v1, the default since 1.34, the policy therefore matched nothing, and the driver ServiceAccount could create or delete ResourceSlices belonging to any node.This adds
v1toapiVersions, and adds bats coverage intests/vap-node-restriction.bats. Those cases run as part ofmake test-e2e(and the existing e2e GitHub Action). They impersonate the driver ServiceAccount and assert that writes for its own node are allowed, while writes for another node and writes from an identity with no node association are denied. The README sample and the multi TPU demo spec are also moved toresource.k8s.io/v1.Which issue(s) this PR is related to:
N/A
Special notes for your reviewer:
It is part of an experiment in bringing the three DRA drivers (dra-example-driver, dra-driver-nvidia-gpu and dra-driver-google-tpu) closer to feature parity, along with a few bugs found along the way.
How it was produced: the implementation was written largely by autonomous coding agents working under my direction, one per feature, each in its own branch.
Verified: go build, go vet, unit tests,
helm lint --strict, the policy rendering all three versions, andmake test-e2eon kind v1.35. The VAP cases pass: create and delete for its own node allowed; create and delete for another node denied; an identity with no node association denied. The regression was also demonstrated live: pinning the policy back to["v1beta1"]let a cross nodev1write from the driver ServiceAccount succeed. An automated code review pass ran on top of this, and its findings were applied and retested. I have now read the full diff; the policy match, the e2e, and the README/demo move from the v1beta1basicdevice wrapper to flattened v1attributesall look correct.AI usage - AI was used during testing and updating the code comments.
Does this PR introduce a user-facing change?
``
release-note
``Fixed the ResourceSlice ValidatingAdmissionPolicy so that it applies on clusters serving resource.k8s.io/v1, where it previously matched no requests.