Add a cleanup worker to remove degenerated spaces
This is a follow up of https://gitlab.com/gitlab-org/gitlab-ce/issues/51716
When a Project is destroyed, we'll have some orphaned records of Cluster::KubernetesNamespaces
. We need to clean those through a cleanup worker.
Also clean up Cluster::KubernetesNamespaces
which should no longer be present for cases where the project transfers group.
Open question:
- Should we also remove namespace, service account and token from Cluster?
- One reason to do this is because of security implications (since the token will exist on the Cluster side).
- But also we disallow to create the same namespace, and the token is limited to the namespace (with
edit
role) so it poses minimal problems - This will destroy all records of deployments to the namespace, and also events.
- What about when a project is transferred to another Group ?
Edited by Thong Kuah