Helm uninstall --cascade orphan command deletes existing K8s resources
- Dominant language
- Go
- Stars
- 30.2k
- Forks
- 7.8k
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 36
Description
We have a use case where we have an existing Helm chart already released. We want to uninstall the existing Helm release but without removing any of the resources already created by the same. So we run the following Helm command:
```
helm uninstall my-release --cascade orphan -n my-namespace
```
This works fine for the resources containing an `ownerReference` field to a CustomResource. However, there are others such as ConfigMaps and ServiceAccounts which don't have such `ownerReference` and these ones are wiped out with the above command.
We would expect the command to not delete any of the existing resource already existing.
As a workaround, we need to execute the following `kubectl` command:
```
kubectl delete secret -l owner=helm,name=my-release -n my-namespace
```
Output of `helm version`:
```
version.BuildInfo{Version:"v3.14.0", GitCommit:"3fc9f4b2638e76f26739cd77c7017139be81d0ea", GitTreeState:"clean", GoVersion:"go1.21.6"}
```
Output of `kubectl version`:
```
Client Version: v1.30.0
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.0
```
Cloud Provider/Platform (AKS, GKE, Minikube etc.): `Minikube`
Contributor guide
Assessment
This issue has not been assessed yet.