feat: add node pool vs control plane version skew validations during nodepool creation #4566
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 #4566"
general
weight: 0.35
JameelB
What
feat: add node pool vs control plane version skew validation at nodepool creation time
Implements node pool version skew validation at CREATE time so version compatibility
between node pools and control planes is enforced before the pool exists, using the
same rules that already govern UPDATE. Extends the admission path so
ServiceProviderClustercontext (needed to read active control-plane versions) is available on CREATE, not just UPDATE.
Changes:
validateNodePoolVersionChange(
internal/admission/admit_nodepool.go), removing theop.Type == operation.Updategate thatpreviously skipped this check entirely on CREATE
checking the nil-ness of
oldObj/ServiceProviderNodePoolrather thanop.Type, since mostrestrictions are universal to both operations
ServiceProviderClusterinto the node pool admission context for CREATE (not only UPDATE),fetching/creating it via
GetOrCreateServiceProviderCluster(frontend/pkg/frontend/node_pool.go)internal/validation/validators.gois unchanged —main's existingValidateNodePoolVersionChangealready handles CREATE correctly (empty active versions naturally skip the UPDATE-only branches)
initial version
Why
While working on #4505 and further reviewing #4554, I realized the frontend was missing version skew
validation during nodepool creation. Without this validation, users could create nodepools with
versions incompatible with the control plane, leading to runtime failures.
Why ServiceProviderCluster is required on CREATE:
The validation needs access to active control plane versions (not just the cluster's desired version)
because:
Validation rules (CREATE, same as UPDATE):
FeatureExperimentalReleaseFeatures)UPDATE continues to enforce the same skew / upgrade-path rules; this PR makes CREATE subject to the
same compatibility policy instead of skipping validation entirely.
Testing
TestAdmitNodePool_VersionValidationOnCreateininternal/admission/admit_nodepool_test.go, covering N-2 skew, exceeding the control plane version,and cross-major changes with/without the AFEC flag
- New
reject-nodepool-creation-version-skew-minus-3asserts CREATE-time N-2 skew rejection(NP
4.22.8vs CP4.25.0→400 InvalidRequestContent)-
invalid-version-updatenow seeds the node pool at a valid version (4.24.0against CP4.26)since CREATE now rejects the old invalid seed
- Other pre-existing fixtures bumped to versions that satisfy the new CREATE-time skew check
aro-pre-mrpipeline (unit, integration, race detector) passesSpecial notes for your reviewer
Layering:
1. Frontend (
frontend/pkg/frontend/node_pool.go): fetches/createsServiceProviderClusterandwires it into the admission context for CREATE, same as it already did for UPDATE
2. Admission (
internal/admission/admit_nodepool.go): business rules — skew / compatibility viavalidateNodePoolVersionChange, now shared by both CREATE and UPDATENon-obvious details:
newNodePoolAdmissionContextnow requiresServiceProviderClusterfor CREATE as well as UPDATE(fails fast with an error if missing)
validateNodePoolVersionChangeis done via nil-checks(
oldObj != nil,spNodePool != nil), notop.Type, per reviewer feedback that most restrictionsare universal
admitNodePoolPlatformstill usesop.Type-based CREATE/UPDATE branching (unchanged frommain);aligning it to the same nil-check style is deferred to a follow-up PR to keep this one focused
FeatureExperimentalReleaseFeatures(see #4479)What to review:
frontend/pkg/frontend/node_pool.go—ServiceProviderClusterfetch/creation before admission on CREATEinternal/admission/admit_nodepool.go— unifiedvalidateNodePoolVersionChangeand CREATE context wiringPR Checklist