Today I Learned (June 10, 2024)

How to uninstall a Helm release only if it exists

The trick is the --ignore-not-found flag available in recent versions of Helm. For example,

$ helm uninstall --ignore-not-found the-release
release "my-release" uninstalled

will uninstall release the-release.

:bulb: Note that Helm—at least in v3.14.2—will always print that it uninstalled the release even if it didn’t exist before.

:link: (StackOverflow.com) Related answer