mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-27 10:18:39 +00:00
## What this PR does When deleting a Kubernetes, some resources may linger post deletion because of a race to remove HelmReleases deployed inside the tenant cluster and the removal of the cluster and its controlplane itself. This patch modifies the existing pre-delete hook to remove those helmreleases instead of simply suspending them. Similarly, datavolumes may also remain. These are now delete with a post-delete hook. ### Release note ```release-note [kubernetes] Use Helm hooks to clean up HelmReleases deployed in tenant clusters and DataVolumes backing the tenant clusters' PVCs when deleting a tenant Kubernetes. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Added an automated post-delete cleanup job to remove persistent data volumes scoped to the release namespace when a release is deleted. * Updated Helm release teardown to actively delete lingering release resources (rather than only suspending them) for cleaner uninstall behavior. * Broadened lifecycle hooks to run on successful completions and expanded teardown permissions to list and delete related release artifacts, including gateway CRDs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->