Repository navigation
Rename 'atomic' -> 'rollback-on-failure' - #13629
Conversation
67c47ed to
af7ae68
Compare
| 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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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 (also, |
sounds good to me, @gjenkins8 have you tried to build binary with your changes and test how all works ? |
| NameTemplate string | ||
| Description string | ||
| OutputDir string | ||
| // RollbackOnFailure enables rolling back (uninstalling) the release on failure if set |
There was a problem hiding this comment.
I don't think this comment is useful and nothing else has a comment here.
There was a problem hiding this comment.
yeah, this is copy/pasta from upgrade.go (which does have comments). I figured I could be the first in install.go
|
@gjenkins8 did we get everything resolved here so we can merge this in? |
59a97de to
73d2aff
Compare
Signed-off-by: George Jenkins <[email protected]>
73d2aff to
08840f0
Compare
…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]>
…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]>
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
--atomicCLI flag is retained, but marked as deprecated.Special notes for your reviewer:
If applicable:
docs neededlabel should be applied if so)