refactor(controller): reconcile pipeline with guaranteed status sync (canary + blue-green). Fixes #4626 #4963
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.59) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 650 lines diff across 8 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
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #4963"
general
weight: 0.35
agaudreault
Summary
syncRolloutStatusCanary()runs after every canary reconcile pass soevaluateProgressDeadlineAbort, progress deadline timeout, andrequeueStuckRolloutcannot be skipped when a stage errors (#4626). Ports #4962's weight-verification safety (stable scale-down hold,shouldFullPromoteverified-weight check, end-of-rollout unverified-weight handling). The only exceptions are ReplicaSet-sync failures (stageFatalNoStatus), wherec.newRSis unreliable and a status computed from it would persist corrupted values (e.g. clear abort state or record a pod hash for a ReplicaSet that was never created).TrafficRoutingApplied,ServicesReconciled,ReconcileSucceeded) merged during status sync; progression gates read current-pass stage condition state. A previously-False condition only recovers to True when its owning stage actually re-ran and succeeded — a pass that stopped before the stage leaves it untouched rather than reporting a phantom recovery.reconcileBlueGreen()andsyncRolloutStatusBlueGreen()always runs afterward, closing the same #4626 wedge class for the blue-green strategy (covered byTestBlueGreenProgressDeadlineAbortNotBlockedByApplyError).awsVerifyTargetGroupsnow marks verification attempted-and-failed when listing TargetGroupBindings errors, so the promotion gate cannot read a failed verification as verified.Additional hardening from review:
promote --fullremains held while traffic weights are unverified or a stage failed this pass (the provider may still be routing traffic to stable); aPromoteFullHeldwarning event now tells the operator why the forced promotion did not take effect.errors.Joininstead ofkerrors.NewAggregate, soerrors.As-based checks (k8serrors.IsNotFoundin the workqueue handler) keep working.weightutil.VerificationPending.ephemeralMetadata,revisionHistory) use a newstageContinueWithErroroutcome: they recordReconcileSucceeded=Falseand still surface the error, but no longer stop the remaining stages — services, traffic routing, and scaling still run. Blue-green gets the same treatment by ordering: both cosmetic steps run last inreconcileBlueGreen, so a denied ReplicaSet deletion can no longer block the active service switch (previouslyreconcileRevisionHistoryLimitran before the service reconcile).hasErrorside channel (swallowed error, fixed 30s requeue, per-passReconciliationErrorevents) and flow through the stage pipeline like every other failure:ReconcileSucceeded=Falsecondition, transition-gated event, workqueue backoff, error metrics. Plugin-protocol phases (StepPluginPhaseErrorbackoff,StepPluginPhaseFailedabort) are unchanged.Supersedes #4962 — same #4626 fix, generalized to all canary stages and to blue-green.
Behavior changes (release note)
1. Rollouts stuck on a persistently failing reconcile step (traffic router, service update, target group verification, analysis, etc.) now evaluate
progressDeadlineAbortevery reconcile and can time out / auto-abort whenprogressDeadlineAbort: true. Previously they could stayProgressingforever. This applies to both canary and blue-green.2. Traffic-routing failures now surface as reconcile errors: they count in reconcile-error metrics and retry with workqueue exponential backoff (previously a fixed ~10s requeue with no error reported). Alerting on controller error rates will now see these failures; retry cadence against a persistently failing provider backs off instead of hammering it.
3. Canary rollouts gain three status conditions that surface reconcile failures:
TrafficRoutingApplied,ServicesReconciled, andReconcileSucceeded. They appear on failure and flip back to True when the failing stage recovers.4.
kubectl argo rollouts promote --fullis held while desired traffic weights are unverified by the provider or a stage failed during the current reconcile; aPromoteFullHeldwarning event is emitted so the hold is visible.5. Failures in cosmetic stages (ephemeral pod metadata labeling, revision-history cleanup) no longer block the rest of the reconcile pass, for both canary and blue-green: services, traffic routing/active-service switching, and scaling still reconcile while the failure is surfaced as a reconcile error (and, on canary, via the
ReconcileSucceededcondition). Step progression still holds on canary until the stage recovers. Scaling-only passes no longer prune blue-green revision history (matching canary).6. Step plugin controller-side errors (plugin resolution or RPC failures) now surface as reconcile errors with exponential backoff and the
ReconcileSucceededcondition, instead of a fixed 30s requeue with aReconciliationErrorevent on every pass. Plugin-reported phases and their configured backoff behave as before.