mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 16:27:28 +02:00
delete cluster key from the clusters list only when delete procedure is finished
This commit is contained in:
@@ -200,6 +200,11 @@ func (c *Controller) processEvent(event spec.ClusterEvent) {
|
||||
lg.Infoln("deletion of the cluster started")
|
||||
|
||||
teamName := strings.ToLower(cl.Spec.TeamID)
|
||||
|
||||
if err := cl.Delete(); err != nil {
|
||||
lg.Errorf("could not delete cluster: %v", err)
|
||||
}
|
||||
|
||||
func() {
|
||||
defer c.clustersMu.Unlock()
|
||||
c.clustersMu.Lock()
|
||||
@@ -216,11 +221,6 @@ func (c *Controller) processEvent(event spec.ClusterEvent) {
|
||||
}
|
||||
}()
|
||||
|
||||
if err := cl.Delete(); err != nil {
|
||||
lg.Errorf("could not delete cluster: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
lg.Infof("cluster has been deleted")
|
||||
case spec.EventSync:
|
||||
lg.Infof("syncing of the cluster started")
|
||||
|
||||
Reference in New Issue
Block a user