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

Deleting app instance with same app name but different Kinds #1410

Open
devdattakulkarni opened this issue Mar 10, 2025 · 1 comment
Open

Comments

@devdattakulkarni
Copy link
Contributor

devdattakulkarni commented Mar 10, 2025

We have seen the following situation happen.

There are two kinds created in a cluster - say KindA, KindB.
We create application instance for KindA, name it - appA
We delete the namespace corresponding to the appA instance using kubectl delete ns appA, without deleting the app instance itself.
We then create application instance for KindB and name it - appA.
KubePlus now creates the Namespace appA again.
Then, we realize that we have a dangling appA instance. So we kubectl delete KindA appA.
This causes the new appA namespace, which now corresponds to the appA instance for KindB, to get deleted. The helm release for appA instance for KindB also gets deleted.

This is a bug as the new appA namespace does not belong to KindA. So when we delete KindA appA, it should just delete the
appA object, without deleting the release or the namespace.

@devdattakulkarni
Copy link
Contributor Author

This will be implemented in helm-pod.
Specifically, in line 340, we need to parse the kind name from the helmrelease variable, compare it with the kind that is passed in (line 279); if they match, then call the go func() to perform the delete action.
helmrelease has following structure: <instance-name>:<lower-case-kind>-<instance-name>
See here and
here
In order to parse kind name from the helmrelease var, String split helmrelease, first on ":", then the second part on "-". From the second split, collect all the parts except the last part.
When comparing the kind name, be sure to convert it into lower case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant