Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm - v3 Release leaks resources on ctrl-c command #2485

Closed
phillipedwards opened this issue Jul 6, 2023 · 4 comments · Fixed by #2579
Closed

Helm - v3 Release leaks resources on ctrl-c command #2485

phillipedwards opened this issue Jul 6, 2023 · 4 comments · Fixed by #2579
Assignees
Labels
area/helm customer/feedback Feedback from customers customer/lighthouse Lighthouse customer bugs and enhancements impact/quality kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@phillipedwards
Copy link
Member

What happened?

During a deployment of helm v3 release, if the user hits ctrl-c Pulumi will leak the resources that have already been created, causing the user to have to manually find and remove the kubernetes resources deployed by the Helm release.

Expected Behavior

Any resources created should not be leaked during a ctrl-c.

Steps to reproduce

deploy a helm release and ctrl-c during an in-flight update.

Output of pulumi about

pulumi/pulumi v3.73.0
pulumi/kubernetes v3.30.0

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@phillipedwards phillipedwards added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jul 6, 2023
@aq17
Copy link

aq17 commented Jul 11, 2023

@phillipedwards just want to clarify – when you say "leak" the resources, do you mean they are created by Pulumi but not recorded in state since the operation is killed?

@aq17 aq17 added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Jul 11, 2023
@phillipedwards
Copy link
Member Author

@aq17 exactly!

@aq17 aq17 added area/helm impact/quality and removed awaiting-feedback Blocked on input from the author labels Jul 11, 2023
@mnlumi mnlumi added customer/feedback Feedback from customers customer/lighthouse Lighthouse customer bugs and enhancements labels Aug 2, 2023
@mnlumi mnlumi added this to the 0.94 milestone Aug 31, 2023
@mnlumi mnlumi assigned mnlumi and rquitales and unassigned mnlumi Sep 13, 2023
@EronWright
Copy link
Contributor

EronWright commented Sep 26, 2023

When the deployment is cancelled, the Helm provider should use the Cancel call to cancel the outstanding install operation and return a partial error with state, to avoid leaking the underlying Helm release.

There's a blocking issue (the Cancel call is not received by the provider for unrelated reasons): pulumi/pulumi#14054

EronWright added a commit that referenced this issue Sep 29, 2023
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md)
    for Pulumi's contribution guidelines.

    Help us merge your changes more quickly by adding more details such
    as labels, milestones, and reviewers.-->

### Proposed changes
Closes #2485.

This PR implements cancelation for `Create` and `Update` operations on
the Helm Release resource. When the user presses ctrl-c, the Helm
operation is cancelled and the stack state is updated accordingly. This
is an improvement over the current behavior where the Helm release may
be orphaned by Pulumi.

A future enhancement would be to implement cancelation for the `Delete`
operation, once it becomes possible in the Helm v3 library (see
[PR](helm/helm#12109) and the `RunWithContext`
variants).

_Note: no new tests are provided because I don't see a way to simulate
cancelation using the integration test framework._

### Related issues (optional)

<!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes
#1234'.
Or link to full URLs to issues or pull requests in other GitHub
repositories. -->
Related to pulumi/pulumi#14057. It is safe to
merge this PR beforehand.
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm customer/feedback Feedback from customers customer/lighthouse Lighthouse customer bugs and enhancements impact/quality kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants