← Back to Pull requests

fix(vpa): resolve parent controllers when informer caches lag #10625

Open
unknown opened this pull request with 261 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 04, 2026 18:36 UTC
Author

What type of PR is this?

/kind bug

What this PR does / why we need it:

VPA can report an existing Job missing while its informer event is delayed, preventing resolution of the Pod's CronJob parent.

Use one typed API GET when a well-known controller is absent from the informer or its cached UID differs from the owner reference. Validate the returned UID, preserve API errors, and leave informer stores unchanged. Matching cache hits remain local. Matching kind and UID establish resource identity, not metadata freshness; owner updates and deletions retain the informer's existing eventual consistency.

Carry owner UIDs from the Pod through the ownership chain, including scalable owners. Expand the regression fixtures and use new(true) with the repository's Go toolchain.

Which issue(s) this PR fixes:

Fixes #10564

Special notes for your reviewer:

Added Job and CronJob identity cases before changing production code. Both stale-cache/current-API recovery cases failed against the published implementation, then passed with the fallback. Coverage also checks replacement/deletion failures, API errors, unchanged cache contents, and zero reads for matching cache hits.

Local validation with Go 1.27.3:

  • go test -race -p 2 -count=3 -timeout=2m ./pkg/target/controller_fetcher ./pkg/utils/vpa passed.

  • go test -race -p 2 -count=1 -timeout=5m ./... passed.

  • golangci-lint 2.15.0: zero issues.

  • Formatting, boilerplate, whitespace, module consistency and VPA verification checks passed. Codegen verification required GOFLAGS='-p=2 -buildvcs=false' for cached tool builds in this environment.
  • Tests use fake clients/informers and local HTTP servers; no live cluster was used.

    Does this PR introduce a user-facing change?

    ``release-note
    VPA can resolve Pod parent controllers when a well-known owner's informer cache is missing the object or still contains a different UID. A live UID mismatch and API errors remain lookup failures.

    
    #### Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
    
    
    docs

    ``

    Diff: 261 lines (+195 / -66) across 3 files Reviewer: adrianmoisey Review duration: 9899m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 261 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.333
    Real PR Conversation Timeline
    1 comments
    "Review active on #10625"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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.2% (MEDIUM) · Higher = larger blast radius
    39.2%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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.9% · Safe to merge
    20.9%