← Back to Pull requests

feat: add node pool vs control plane version skew validations during nodepool creation #4566

Closed
unknown closed this pull request without merging on Sep 07, 2026 17:39 UTC
View on GitHub
unknown unknown commented on Mar 21, 2026 12:24 UTC
Author

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 ServiceProviderCluster
context (needed to read active control-plane versions) is available on CREATE, not just UPDATE.

Changes:

  • Unify CREATE and UPDATE version validation into the existing validateNodePoolVersionChange

  • (internal/admission/admit_nodepool.go), removing the op.Type == operation.Update gate that
    previously skipped this check entirely on CREATE
  • Distinguish CREATE vs UPDATE-only logic (desired-version skip, active-versions lookup) by

  • checking the nil-ness of oldObj / ServiceProviderNodePool rather than op.Type, since most
    restrictions are universal to both operations
  • Pass ServiceProviderCluster into the node pool admission context for CREATE (not only UPDATE),

  • fetching/creating it via GetOrCreateServiceProviderCluster (frontend/pkg/frontend/node_pool.go)
  • internal/validation/validators.go is unchanged — main's existing ValidateNodePoolVersionChange

  • already handles CREATE correctly (empty active versions naturally skip the UPDATE-only branches)
  • Update integration test artifacts for CREATE-time skew and UPDATE flows that now require a valid

  • 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:

  • During control plane upgrades, multiple versions may be active simultaneously

  • Nodepools must remain compatible with the lowest active CP version (cannot exceed it)

  • Nodepools can be created during CP upgrades and must respect the active version range
  • Validation rules (CREATE, same as UPDATE):

  • Node pool version ≤ lowest active control plane version

  • Node pool version within N-2 minor skew of the highest active control plane version

  • Cross-major compatibility via allowlist (gated by 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

  • Unit tests: Added TestAdmitNodePool_VersionValidationOnCreate in

  • internal/admission/admit_nodepool_test.go, covering N-2 skew, exceeding the control plane version,
    and cross-major changes with/without the AFEC flag
  • Integration tests:

  • - New reject-nodepool-creation-version-skew-minus-3 asserts CREATE-time N-2 skew rejection
    (NP 4.22.8 vs CP 4.25.0 → 400 InvalidRequestContent)
    - invalid-version-update now seeds the node pool at a valid version (4.24.0 against CP 4.26)
    since CREATE now rejects the old invalid seed
    - Other pre-existing fixtures bumped to versions that satisfy the new CREATE-time skew check
  • Manual: Full aro-pre-mr pipeline (unit, integration, race detector) passes
  • Special notes for your reviewer

    Layering:
    1. Frontend (frontend/pkg/frontend/node_pool.go): fetches/creates ServiceProviderCluster and
    wires 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 via
    validateNodePoolVersionChange, now shared by both CREATE and UPDATE

    Non-obvious details:

  • newNodePoolAdmissionContext now requires ServiceProviderCluster for CREATE as well as UPDATE

  • (fails fast with an error if missing)
  • Distinguishing CREATE vs UPDATE inside validateNodePoolVersionChange is done via nil-checks

  • (oldObj != nil, spNodePool != nil), not op.Type, per reviewer feedback that most restrictions
    are universal
  • admitNodePoolPlatform still uses op.Type-based CREATE/UPDATE branching (unchanged from main);

  • aligning it to the same nil-check style is deferred to a follow-up PR to keep this one focused
  • Cross-major 4.x↔5.x allowlist remains behind FeatureExperimentalReleaseFeatures (see #4479)
  • What to review:

  • frontend/pkg/frontend/node_pool.go — ServiceProviderCluster fetch/creation before admission on CREATE

  • internal/admission/admit_nodepool.go — unified validateNodePoolVersionChange and CREATE context wiring

  • Integration artifacts above for expected CREATE vs UPDATE behavior
  • PR Checklist

  • PR is scoped to a single task (no mixed concerns)

  • Title follows Conventional Commits format

  • Summary explains the "Why" behind the change

  • Linked to relevant ticket/issue

  • Screenshots included (if graph/UI/metrics changes) — N/A

  • Self-reviewed the diff

  • CI/CD checks are passing (ignore Tide)

  • Draft PR used for WIP — Final, ready to merge

  • Commit history is clean (rebased/squashed)

  • Tricky code blocks are commented

  • Specific reviewers tagged

  • All comment threads resolved before merge
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: JameelB Review duration: 245115m
    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
    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%
    60%
    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 #4566"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 20.5% · Safe to merge
    20.5%
    Repository