set cluster name if delete happens too soon

This commit is contained in:
Felix Kunde 2019-08-21 12:01:26 +02:00
parent abdb003f40
commit c7fc4bf9a4
1 changed files with 8 additions and 0 deletions

View File

@ -258,6 +258,14 @@ func (c *Controller) processEvent(event ClusterEvent) {
} }
lg.Infoln("deletion of the cluster started") lg.Infoln("deletion of the cluster started")
// HACK if a delete happens too soon, cl fields are empty
// thus, pods, logical backup jobs and headless service will not get deleted
// see issues 551, 218
if cl.Name == "" {
cl.Name = clusterName.Name
cl.Namespace = clusterName.Namespace
}
teamName := strings.ToLower(cl.Spec.TeamID) teamName := strings.ToLower(cl.Spec.TeamID)
c.curWorkerCluster.Store(event.WorkerID, cl) c.curWorkerCluster.Store(event.WorkerID, cl)