removing inner goroutine in cluster.Switchover and resolve race between processPodEvent and unregisterPodSubscriber

This commit is contained in:
Felix Kunde
2022-05-05 16:05:33 +02:00
parent a77d5df158
commit 3641911786
4 changed files with 28 additions and 44 deletions
+3 -2
View File
@@ -451,17 +451,18 @@ func (c *Controller) Run(stopCh <-chan struct{}, wg *sync.WaitGroup) {
panic("could not acquire initial list of clusters")
}
wg.Add(5)
wg.Add(5 + util.Bool2Int(c.opConfig.EnablePostgresTeamCRD))
go c.runPodInformer(stopCh, wg)
go c.runPostgresqlInformer(stopCh, wg)
go c.clusterResync(stopCh, wg)
go c.apiserver.Run(stopCh, wg)
go c.kubeNodesInformer(stopCh, wg)
if c.opConfig.EnablePostgresTeamCRD {
go c.runPostgresTeamInformer(stopCh, wg)
}
go c.apiserver.Run(stopCh, wg)
c.logger.Info("started working in background")
}