Skip to content

fix(action): mark the new revision failed when a rollback aborts early - #32880

Open
A-RYAN-1 wants to merge 1 commit into
helm:mainfrom
A-RYAN-1:fix/32867-rollback-mark-failed
Open

A-RYAN-1 wants to merge 1 commit into
helm:mainfrom
A-RYAN-1:fix/32867-rollback-mark-failed

Conversation

@A-RYAN-1

@A-RYAN-1 A-RYAN-1 commented Nov 9, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

When helm rollback fails on a build error, a pre-rollback hook, a post-rollback hook or the waiter setup, performRollback returned without updating the stored revision. It stayed pending-rollback, and every later upgrade failed with another operation (install/upgrade/rollback) is in progress. This records the new revision as failed on those paths through a small failRollback helper, the same way upgrade does. The previous deployed revision is left untouched, as it is for a failed upgrade hook.

closes #32867

Special notes for your reviewer:

The new test covers a failing pre-rollback hook, a failing post-rollback hook and a build error, and fails on the base with the revision stuck in pending-rollback. The waiter setup path has no test because the fake kube client cannot fail GetWaiter.

Open point: the returns after the cluster is already rolled back (DeployedAll, the supersede loop and the final Releases.Update in Run) are left as they are. They are storage errors, and marking the revision failed there would describe a cluster that did roll back. Happy to cover them if you prefer.

If applicable:

  • this PR contains user facing changes (the docs needed label should be applied if so)
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

When helm rollback failed on a build error, a pre-rollback hook or a
post-rollback hook, performRollback returned without updating the stored
revision. It stayed pending-rollback, and every later upgrade failed with
"another operation is in progress".

Record the revision as failed on those paths, as upgrade already does.
The current revision is left untouched.

Fixes helm#32867

Signed-off-by: Aryan Deshmukh <[email protected]>
@pull-request-size pull-request-size Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 9, 2026
@github-actions github-actions Bot added the v4.x Issues and Pull Requests related to the major version v4 label Nov 9, 2026
@A-RYAN-1

Copy link
Copy Markdown
Author

Checks are green and the branch merges cleanly with DCO signed. Could a maintainer take a first look when there is time? Happy to adjust the test or the approach.

@A-RYAN-1

Copy link
Copy Markdown
Author

Friendly ping for a review when someone has time. DCO is signed, and I'm happy to change anything.

@A-RYAN-1

Copy link
Copy Markdown
Author

Could a maintainer take a first pass at this when the review queue allows? Happy to rework any part of it.

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

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files. v4.x Issues and Pull Requests related to the major version v4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rollback: hook or build failure leaves the new revision stuck in pending-rollback

1 participant