mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 18:08:29 +02:00
Fix deletion of the failed cluster; more debug messages
This commit is contained in:
@@ -125,7 +125,7 @@ func (c *Controller) podEventsDispatcher(stopCh <-chan struct{}) {
|
||||
c.logger.Debugf("Sending %s event of Pod '%s' to the '%s' cluster channel", event.EventType, event.PodName, event.ClusterName)
|
||||
go subscriber.ReceivePodEvent(event)
|
||||
} else {
|
||||
c.logger.Debugf("Skipping Pods unrelated to clusters: %s", event.PodName)
|
||||
c.logger.Debugf("Skipping %s event of the '%s' pod", event.EventType, event.PodName)
|
||||
}
|
||||
case <-stopCh:
|
||||
return
|
||||
|
||||
@@ -98,6 +98,8 @@ func (c *Controller) postgresqlAdd(obj interface{}) {
|
||||
cl := cluster.New(c.makeClusterConfig(), *pg, c.logger.Logger)
|
||||
|
||||
c.clusters[clusterName] = cl
|
||||
stopCh := make(chan struct{})
|
||||
c.stopChMap[clusterName] = stopCh
|
||||
|
||||
cl.SetStatus(spec.ClusterStatusCreating)
|
||||
if err := cl.Create(); err != nil {
|
||||
@@ -106,8 +108,6 @@ func (c *Controller) postgresqlAdd(obj interface{}) {
|
||||
return
|
||||
}
|
||||
cl.SetStatus(spec.ClusterStatusRunning) //TODO: are you sure it's running?
|
||||
stopCh := make(chan struct{})
|
||||
c.stopChMap[clusterName] = stopCh
|
||||
go cl.Run(stopCh)
|
||||
|
||||
c.logger.Infof("Postgresql cluster '%s' has been created", clusterName)
|
||||
@@ -165,7 +165,7 @@ func (c *Controller) postgresqlDelete(obj interface{}) {
|
||||
return
|
||||
}
|
||||
|
||||
c.logger.Infof("Cluster delete: %s", util.NameFromMeta(pgCur.Metadata))
|
||||
c.logger.Infof("Starting deletion of the '%s' cluster", util.NameFromMeta(pgCur.Metadata))
|
||||
if err := pgCluster.Delete(); err != nil {
|
||||
c.logger.Errorf("Can't delete cluster '%s': %s", clusterName, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user