Skip to content

Potential issue: --atomic --cleanup-on-fail invoke a rollback without --cleanup-on-fail #7876

Closed

Description

@consideRatio

I think a helm upgrade --atomic --cleanup-on-fail that results in a rollback could run into an unexpected issue.

  • --atomic's rollback operation is not influenced by --cleanup-on-fail passed to the upgrade command (ref: code).
  • If the --atomic invoked rollback fail, it will not --cleanup-on-fail (ref: code)
  • It is possible to have --cleanup-on-fail be part of a rollback operation (ref: code)

I expected the --cleanup-on-fail to pass through also to the rollback operation if used in conjunction with --atomic. I'm not confident it will matter, but could perhaps the rollback operation render new templates that would fail to be cleaned up?

To figure that out, i guess it may be relevant to consider the built in objects and chart hooks.


Output of helm version:

version.BuildInfo{Version:"v3.1.2", GitCommit:"d878d4d45863e42fd5cff6743294a11d28a9abce", GitTreeState:"clean", GoVersion:"go1.13.8"}

Activity

  1. technosophos commented on Apr 6, 2020

    @technosophos
    Member

    I am not sure I follow the logic there. Can you produce a proof-of-concept?

    It is definitely (under a wide variety of circumstances) possible to have a rollback fail. But when a rollback-on-failure fails, the behavior of the cleanup is very tricky. It is not at all clear what a user expects in that scenario. Our strategy in these cases is to not clean up after a failed rollback because a failed rollback may indicate that something is really wrong. We treat --cleanup-on-fail as only applying to the requested release, not the rollback if the requested release fails.

    I am not sure if you are suggesting a way to improve this, or merely suggesting that we should change the meaning of --cleanup-on-fail to include cleaning up failed rollbacks (which sounds possibly too destructive to me). But an example case might help clarify things for me.

  2. consideRatio commented on Apr 6, 2020

    @consideRatio
    ContributorAuthor

    @technosophos my main personal concern was that it was too much ambiguity of how --cleanup-on-fail worked.

    I've not experienced an issue from a failing rollback with --atomic and have no input on what is the best default behavior. But, if the default doesn't involve --cleanup-on-fail for the atomic rollback operation even though --cleanup-on-fail was specified (and applied for the upgrade operation), I think that should be documented within the CLI's --help text that it only applies to the new resources in the upgrade, but not the potential rollback caused by --atomic.

  3. technosophos commented on Apr 6, 2020

    @technosophos
    Member

    Yeah, for sure it should be documented.

    It is possible that our assumptions about rollbacks are wrong. Recovery is definitely a tangled web.

  4. github-actions commented on Aug 21, 2020

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  5. bridgetkromhout commented on Sep 19, 2020

    @bridgetkromhout
    Member

    Removing stale label as I intend to document.

  6. github-actions commented on Dec 19, 2020

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions