Skip to content

fix: keep Failed canary revisions until the primary is ready - #2002

Open
sarankumar1325 wants to merge 1 commit into
fluxcd:mainfrom
sarankumar1325:fix/1995-failed-canary-new-revision
Open

sarankumar1325 wants to merge 1 commit into
fluxcd:mainfrom
sarankumar1325:fix/1995-failed-canary-new-revision

Conversation

@sarankumar1325

Copy link
Copy Markdown

Description

When a canary is Failed, shouldAdvance used to call SyncStatus before HasTargetChanged. That wrote the current template hash into status.lastAppliedSpec. If the primary was not ready on that tick, advanceCanary returned without starting analysis, and later ticks no longer saw a target change.

Move the Failed-state SyncStatus to after the change checks, so a new revision stays pending until the primary is ready and analysis can start.

Verification

  • New test TestScheduler_DeploymentFailedKeepsNewRevisionUntilPrimaryReady
  • go test ./pkg/controller/ -run TestScheduler_DeploymentFailedKeepsNewRevisionUntilPrimaryReady

Fixes #1995

SyncStatus for a Failed canary rewrote lastAppliedSpec before
HasTargetChanged ran. A new revision that arrived while the primary was
not ready was then treated as already applied, so analysis never started.

Check for target and dependency changes first; only SyncStatus when
nothing changed.

Fixes fluxcd#1995

Signed-off-by: sarankumar1325 <120080287+sarankumar1325@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed canary permanently ignores a new revision that arrives while the primary is not ready

1 participant