← Back to Pull requests

kubevirteps: derive infra endpoint conditions from the tenant endpoints #421

Closed
unknown closed this pull request without merging on Sep 30, 2026 06:29 UTC
View on GitHub
unknown unknown commented on Sep 23, 2026 13:03 UTC
Author

What this PR does / why we need it:

Fold the conditions of every tenant endpoint on a node: ready if any is ready, serving if any is serving, terminating if all are, or if none is ready and one is serving and terminating (the endpoints kube-proxy and Cilium fall back to when none is ready, so a pod that is still starting does not hide a pod that is draining on the same VM). Combine with the VMI phase (ready/serving only while Running; Failed/Succeeded is terminating whatever the tenant says). Nil conditions are read as the EndpointSlice API defines them (ready and serving true, terminating false); a terminating endpoint is never counted as ready. Tenant endpoints with no nodeName are skipped (they dereferenced nil before).

No change to how the controller is triggered: the tenant-slice UpdateFunc already requeues on every update and EndpointsEqualBeyondHash compares conditions, so a condition-only change already reaches the infra slice; only what was written into it was wrong.

Which issue(s) this PR fixes:
Fixes #420

Special notes for your reviewer:

  • make test (go test ./pkg/...) passes; go vet and gofmt are clean.

  • Ten table cases in kubevirteps_controller_test.go; without this change five fail and the nil-node case panics.

  • Measured in our own build of v0.6.0 with the first version of this change, on the same kind of node-pool delete (two replicas, preStop 5 s): the infra VM left the ready set within about a second of the tenant endpoints, Hubble showed no ACK, RST, and the pods kept answering through their preStop as serving endpoints — Kubernetes' graceful-termination semantics end to end. The review change to terminating gives the same result in that case (every endpoint on the VM was terminating).

  • Rebased on main after #417.
  • Checklist

    This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
    Approvers are expected to review this list.

  • Design: A design document was considered and is present (link) or not required

  • PR: The PR description is expressive enough and will help future contributors

  • Code: Write code that humans can understand and Keep it simple

  • Refactor: You have left the code cleaner than you found it (Boy Scout Rule)

  • Upgrade: Impact of this change on upgrade flows was considered and addressed if required

  • Testing: New code requires new unit tests. New features and bug fixes require at least on e2e test

  • Documentation: A user-guide update was considered and is present (link) or not required. You want a user-guide update if it's a user facing feature / API change.

  • Community: Announcement to kubevirt-dev was considered
  • Release note:
    ``release-note
    The kubevirteps controller derives each infra endpoint's ready, serving and terminating conditions from the tenant endpoints on that VM as well as from the VMI phase. A Running VMI is no longer ready when none of its tenant endpoints is ready: while its pods terminate, but also when their readiness probes fail or the tenant node is NotReady. While none is ready but one is still serving and terminating, the VM is advertised as serving and terminating, so load balancers can fall back to it.
    ``

    Diff: 464 lines (+348 / -116) across 5 files Reviewer: aimnbrs Review duration: 9685m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.69) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.69 · 464 lines diff across 5 files
    0.69
    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.367
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.069
    Real PR Conversation Timeline
    1 comments
    "Review active on #421"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 68.8% (HIGH) · Higher = larger blast radius
    68.8%
    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: 27.2% · Safe to merge
    27.2%