helm icon indicating copy to clipboard operation
helm copied to clipboard

helm uninstall: erroneous exit code if no release found

Open DanielHabenicht opened this issue 5 years ago • 10 comments

If a release was not previously installed and helm uninstall release-name is run the following error occurs:

Error: uninstall: Release not loaded: release-name: release: not found

That's fine and having read your design considerations I understand the reasoning behind the default behavior and it should not be altered.

Looking at it from the automation perspective I would propose it as useful to add a flag similar to the helm upgrade --install flag. It would accept release: not found as successful uninstallation, as technically it was successfully uninstalled. Currently running the command in a CI pipeline errors if e.g. a previous installation wasn't successful and everything is teared down.

Currently one has to use || true but this has the drawback that it hides all errors, even those that might really happen during an uninstall.

I have searched for similar issues but haven't found one, sorry if I might have overlooked it.

Output of helm version: version.BuildInfo{Version:"v3.5.3", GitCommit:"041ce5a2c17a58be0fcd5f5e16fb3e7e95fea622", GitTreeState:"dirty", GoVersion:"go1.15.8"}

DanielHabenicht avatar May 10 '21 08:05 DanielHabenicht

It is useful, I have implemented it.

cndoit18 avatar May 12 '21 02:05 cndoit18

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.

github-actions[bot] avatar Aug 11 '21 00:08 github-actions[bot]

Has this option been added? the PR (https://github.com/helm/helm/pull/9689) seemed to be reviewed, changed according to suggestions but never approved and merged. Currently with conflicts.

This feature has been implemented otherwise?

davidema79 avatar Mar 04 '22 18:03 davidema79

no, not that I know

DanielHabenicht avatar Mar 04 '22 22:03 DanielHabenicht

Hi, this would be useful to have

remidebette avatar May 17 '22 09:05 remidebette

  • 1 waiting for this

CTBT avatar Jul 11 '22 15:07 CTBT

Agreed, this would be very useful!

vakenbolt avatar Aug 11 '23 04:08 vakenbolt

same issue: https://github.com/helm/helm/issues/3352

cndoit18 avatar Aug 11 '23 09:08 cndoit18

same need please merge

Seems that is has been added to the documentation but not working yet... https://helm.sh/docs/helm/helm_uninstall/ image

image

hamzdi avatar Nov 13 '23 10:11 hamzdi

Fix has be merged in V3.13.0.

matthieu-dubin avatar Nov 17 '23 10:11 matthieu-dubin