Avoid terminating delete on errors.

When there is an error happening upon deletion of the Kubernetes object
belonging to the cluster being removed, it makes no sense to abort the
deletion: the manifest will be removed anyway, therefore all the objects
after the one we aborted at will stay forever.
This commit is contained in:
Oleksii Kliukin
2018-05-18 18:10:37 +02:00
parent 88d6a7be3f
commit 27c7245fed
2 changed files with 9 additions and 13 deletions
+1 -3
View File
@@ -230,9 +230,7 @@ func (c *Controller) processEvent(event spec.ClusterEvent) {
teamName := strings.ToLower(cl.Spec.TeamID)
c.curWorkerCluster.Store(event.WorkerID, cl)
if err := cl.Delete(); err != nil {
lg.Errorf("could not delete cluster: %v", err)
}
cl.Delete()
func() {
defer c.clustersMu.Unlock()