Skip to content

Rename 'atomic' -> 'rollback-on-failure' - #13629

Merged
gjenkins8 merged 1 commit into
helm:mainfrom
gjenkins8:rename_atomic_rollbackonfailure
Aug 22, 2025
Merged

gjenkins8 merged 1 commit into
helm:mainfrom
gjenkins8:rename_atomic_rollbackonfailure

Conversation

@gjenkins8

Copy link
Copy Markdown
Member

What this PR does / why we need it:
Helm implements functionality to revert a failed upgrade/install. Uninstalling the release for installs, rolling back on upgrades. This PR renames this functionality to "rollback-on-failure", rather than today's "atomic".

The reason for the rename, is that "atomic" is misleading (the intermediate states of the operation are very visible to users, and there is no guarantee that the reversion to the original state won't fail) . And using more "plain language" terminology makes the feature more accessible and visible to users.

The --atomic CLI flag is retained, but marked as deprecated.

Special notes for your reviewer:

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

@pull-request-size pull-request-size Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 13, 2025
@gjenkins8
gjenkins8 force-pushed the rename_atomic_rollbackonfailure branch from 67c47ed to af7ae68 Compare January 13, 2025 17:04
@gjenkins8 gjenkins8 added the docs needed Indicates that a PR includes changes that need to be documented. Should not block a PR being merged label Jan 13, 2025
Comment thread pkg/action/upgrade.go Resolved
Comment thread pkg/action/install.go Resolved
Comment thread cmd/helm/install.go Outdated
f.BoolVar(&client.DependencyUpdate, "dependency-update", false, "update dependencies if they are missing before installing the chart")
f.BoolVar(&client.DisableOpenAPIValidation, "disable-openapi-validation", false, "if set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema")
f.BoolVar(&client.Atomic, "atomic", false, "if set, the installation process deletes the installation on failure. The --wait flag will be set automatically if --atomic is used")
f.BoolVar(&client.RollbackOnFailure, "rollback-on-failure", false, "if set, Helm will rollback (uninstall) the installation on failure. The --wait flag will be set automatically if --rollback-on-failure is used")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe clarify that Helm will rollback to previous revision (uninstall). Lot of ppl using helm often tends to believe that rollbackOnFailure will rollback to a previous stable revision which is not the case

@gjenkins8 gjenkins8 Jan 25, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not quite following sorry

I have:

if set, Helm will rollback (uninstall) the installation on failure.

For install, a "rollback" is an uninstall. Which is what the above is trying to say. But it makes sense IMHO to have the same flag for both installs and upgrades for consistency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I meant to comment on the upgrade.go change . Rollback on an upgrade with --atomic flag will revert to previous revision as per my understanding. It will do an uninstall if its an install or first revision.

@robertsirc robertsirc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to update the const installDesc with some clarity there for end users this might address @godhanipayal concerns as well. Other than that the code builds and passes all unit test.

@gjenkins8

gjenkins8 commented Jan 25, 2025 •

Copy link
Copy Markdown
Member Author

I think you need to update the const installDesc with some clarity there for end users this might address @godhanipayal concerns as well. Other than that the code builds and passes all unit test.

I could add some details for --rolback-on-failure to installDesc. But I would prefer to have the flag description for the --rollback-on-failure good enough (and so keep the details/description in one place, rather than have the behavior details sprawl into multiple places that a user has to find/read).

(also, --atomic doesn't have a mention in installDesc. If we think docs are necessary for either --rollback-on-failure or --atomic (however the flag is spelt), we should perhaps add those regardless ie. a separate PR IMHO)

@miledxz

miledxz commented Jan 26, 2025

Copy link
Copy Markdown
Contributor

I think you need to update the const installDesc with some clarity there for end users this might address @godhanipayal concerns as well. Other than that the code builds and passes all unit test.

I could add some details for --rolback-on-failure to installDesc. I would prefer to have the description for the --rollback-on-failure good enough (keep the description in one place, rather than have them sprawl into multiple places that a user has to find/read.

(also, --atomic doesn't have a mention in installDesc. If we think docs are necessary for either --rollback-on-failure or --atomic (however the flag is spelt), we should perhaps add those regardless ie. a separate PR IMHO)

sounds good to me, @gjenkins8 have you tried to build binary with your changes and test how all works ?
I will be looking more closely to help out there

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit on

Comment thread pkg/action/install.go
NameTemplate string
Description string
OutputDir string
// RollbackOnFailure enables rolling back (uninstalling) the release on failure if set

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this comment is useful and nothing else has a comment here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this is copy/pasta from upgrade.go (which does have comments). I figured I could be the first in install.go

@robertsirc

Copy link
Copy Markdown
Member

@gjenkins8 did we get everything resolved here so we can merge this in?

@gjenkins8
gjenkins8 force-pushed the rename_atomic_rollbackonfailure branch from 59a97de to 73d2aff Compare April 19, 2025 16:04

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gjenkins8
gjenkins8 force-pushed the rename_atomic_rollbackonfailure branch from 73d2aff to 08840f0 Compare July 21, 2025 20:47
@gjenkins8 gjenkins8 added this to the v4 milestone Aug 21, 2025
@gjenkins8
gjenkins8 requested a review from robertsirc August 22, 2025 17:51

@robertsirc robertsirc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

yxxhero added a commit to helmfile/helmfile that referenced this pull request Jul 31, 2026
…mic (#2712)

Helm 4 renamed the `--atomic` flag to `--rollback-on-failure`
(helm/helm#13629). The old flag still works under Helm 4 but is
deprecated (prints a warning) and slated for removal in Helm 5.

Add a `rollbackOnFailure` key to both `helmDefaults` (HelmSpec) and
`releases[]` (ReleaseSpec) that emits `--rollback-on-failure`. It
requires Helm 4+ (errors otherwise) and is mutually exclusive with
`atomic`.

Additionally, when the resolved Helm binary is v4+, an existing
`atomic: true` now emits `--rollback-on-failure` instead of `--atomic`,
so users are migrated off the deprecated flag automatically without any
config change. On older Helm, `atomic: true` continues to emit
`--atomic`.

Updated the spew-based values-ID hashes in temp_test.go that change
whenever ReleaseSpec gains a field (same approach as the --force-conflicts
change in #2480).

Closes #2712.

Signed-off-by: yxxhero <[email protected]>
yxxhero added a commit to helmfile/helmfile that referenced this pull request Jul 31, 2026
…mic (#2722)

* feat: support Helm 4 --rollback-on-failure alongside deprecated --atomic (#2712)

Helm 4 renamed the `--atomic` flag to `--rollback-on-failure`
(helm/helm#13629). The old flag still works under Helm 4 but is
deprecated (prints a warning) and slated for removal in Helm 5.

Add a `rollbackOnFailure` key to both `helmDefaults` (HelmSpec) and
`releases[]` (ReleaseSpec) that emits `--rollback-on-failure`. It
requires Helm 4+ (errors otherwise) and is mutually exclusive with
`atomic`.

Additionally, when the resolved Helm binary is v4+, an existing
`atomic: true` now emits `--rollback-on-failure` instead of `--atomic`,
so users are migrated off the deprecated flag automatically without any
config change. On older Helm, `atomic: true` continues to emit
`--atomic`.

Updated the spew-based values-ID hashes in temp_test.go that change
whenever ReleaseSpec gains a field (same approach as the --force-conflicts
change in #2480).

Closes #2712.

Signed-off-by: yxxhero <[email protected]>

* test: add integration test for rollback-on-failure / atomic migration (#2712)

Covers the end-to-end plumbing that unit tests cannot (real helm version
detection + cluster deploy) via test/integration/run.sh:

  1. atomic: true parses, deploys a ConfigMap, and emits the version-correct
     flag: --rollback-on-failure on Helm 4 (auto-migration of the deprecated
     --atomic) and --atomic on Helm 3.
  2. rollbackOnFailure: true emits --rollback-on-failure on Helm 4 and is
     rejected with a clear Helm-4-required error on Helm 3.

Flag assertions grep the `exec: helm upgrade --install` lines logged under
--debug, matching flags as standalone tokens so the release name
"issue-2712-atomic" cannot be confused with the "--atomic" flag.

Verified locally against Helm 4.2.3: both atomic:true and
rollbackOnFailure:true emit --rollback-on-failure with no --atomic.

Signed-off-by: yxxhero <[email protected]>

---------

Signed-off-by: yxxhero <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs needed Indicates that a PR includes changes that need to be documented. Should not block a PR being merged refactor size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants