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
.
Note that Helm—at least in v3.14.2—will always print that it uninstalled the release even if it didn’t exist before.