mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-22 06:28:01 +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")
|
lg.Infoln("deletion of the cluster started")
|
||||||
|
|
||||||
teamName := strings.ToLower(cl.Spec.TeamID)
|
teamName := strings.ToLower(cl.Spec.TeamID)
|
||||||
|
|
||||||
|
if err := cl.Delete(); err != nil {
|
||||||
|
lg.Errorf("could not delete cluster: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
func() {
|
func() {
|
||||||
defer c.clustersMu.Unlock()
|
defer c.clustersMu.Unlock()
|
||||||
c.clustersMu.Lock()
|
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")
|
lg.Infof("cluster has been deleted")
|
||||||
case spec.EventSync:
|
case spec.EventSync:
|
||||||
lg.Infof("syncing of the cluster started")
|
lg.Infof("syncing of the cluster started")
|
||||||
|
|||||||
Reference in New Issue
Block a user