← Back to Pull requests

AUTOSCALE-1058: Refactor EC2 and Azure NodeClass controllers #65

Closed
unknown closed this pull request without merging on Oct 29, 2026 15:29 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 18:08 UTC
Author

Implements AUTOSCALE-1058. Splits the EC2 NodeClass reconciler into focused controllers and shares the admission policy controller between AWS and Azure.

Structure

  • nodeclass/ec2 only reconciles OpenshiftEC2NodeClass into EC2NodeClass and syncs status.

  • New nodeclass/ec2/subnet controller (ec2-nodeclass-subnets) owns the management-cluster karpenter-subnets ConfigMap.

  • New shared nodeclass/vap controller (nodeclass-vap) owns the ValidatingAdmissionPolicy and binding for both providers, replacing nodeclass/azure/vap and the VAP code in the EC2 reconciler. Providers supply the policy; the controller adds the exclude-hcco-user match condition.

  • HCPNodeClassProvider.NewControllers now receives the manager.
  • Behavioral changes

  • Subnets of a terminating OpenshiftEC2NodeClass stay in the ConfigMap until the NodeClass is gone. Previously they were dropped as soon as deletion started, which could detach VPC endpoint subnets while NodeClaims were still being cleaned up.

  • When no NodeClass has resolved subnets, the ConfigMap is updated to subnetIDs: [] instead of being deleted. This avoids delete/recreate churn and gives HyperShift an explicit empty list; the HostedControlPlane owner reference still cleans it up.

  • The ConfigMap is not recreated while the HostedControlPlane is being deleted, and it is left untouched while the core-E2E override annotation is set.

  • The ConfigMap is recomputed on NodeClass, ConfigMap, or HostedControlPlane InfraID/override changes, rather than as a side effect of each NodeClass reconcile.

  • The EC2 admission policy is created at startup instead of on the first NodeClass reconcile. It is paused while the core-E2E override is set and re-applied when the override is removed.

  • The controller owns the whole spec of the policy and binding, so out-of-band edits are reverted. Previously only selected fields were set.

  • Controller names changed to ec2-nodeclass-subnets and nodeclass-vap (previously azure-nodeclass-vap), which affects log and metric labels.
  • Validation

    go test ./pkg/... -count=1, go vet ./..., golangci-lint run ./..., make verify. /test e2e-aws-autonode-standalone-ko still to run.

    Diff: 283 lines (+212 / -71) across 3 files Reviewer: Fedosin Review duration: 12800m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 283 lines diff across 3 files
    0.40
    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.338
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #65"
    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: 39.7% (MEDIUM) · Higher = larger blast radius
    39.7%
    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: 15.7% · Safe to merge
    15.7%