Skip to content

Fix failed rollback after canceled health check - #1605

Open
ruslan-shaydullin wants to merge 1 commit into
fluxcd:mainfrom
ruslan-shaydullin:fix/1557-skip-remediation-when-enqueued
Open

ruslan-shaydullin wants to merge 1 commit into
fluxcd:mainfrom
ruslan-shaydullin:fix/1557-skip-remediation-when-enqueued

Conversation

@ruslan-shaydullin

@ruslan-shaydullin ruslan-shaydullin commented Oct 6, 2026 •

Copy link
Copy Markdown

Fixes: #1557

With the CancelHealthCheckOnNewRevision feature gate enabled and upgrade remediation configured, the rollback starts in the same reconciliation in which the health check was canceled, applies the previous release, waits on the already canceled interrupt context, fails with context canceled and leaves a second failed release in Helm storage. After a real timeout the rollback completes.

I added a check before the rollback: if the object is enqueued again, the reconciler requeues instead, regardless of why it was enqueued or why the upgrade failed, as it already does with IsObjectEnqueued when AtomicRelease returns an error. The canceled upgrade is still recorded as a failed release. The next reconciliation upgrades if the chart or values changed, otherwise it runs the same rollback on a fresh interrupt context. Resources only in the canceled release stay after that upgrade, where the failed rollback used to remove them; with RetryOnFailure they stay on main too.

With CancelHealthCheckOnNewRevision enabled, a new reconcile request
cancels the health check of a running upgrade and the upgrade fails.
If upgrade remediation is configured, the rollback starts in the same
reconcile: it applies the previous manifests, waits on the already
canceled context, fails as well and leaves a second failed revision
behind.

Requeue instead of starting the rollback when the object has been
enqueued again. The next reconcile runs the rollback if nothing
changed, or upgrades if the chart or values did.

Signed-off-by: Ruslan Shaydullin <shaydullin.r.d@outlook.com>
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.

CancelHealthCheckOnNewRevision starts and interrupts extra rollbacks

1 participant