fix(vpa): resolve parent controllers when informer caches lag #10625
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
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
adrianmoisey
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/vpapassed.go test -race -p 2 -count=1 -timeout=5m ./...passed.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-noteVPA 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.
docs
``