Use queues for the pod events (#30)

This commit is contained in:
Murat Kabilov
2017-05-23 15:24:14 +02:00
committed by GitHub
parent 132c8425e6
commit 009db16c7c
6 changed files with 96 additions and 79 deletions
+1 -6
View File
@@ -7,7 +7,7 @@ import (
"github.com/zalando-incubator/postgres-operator/pkg/util/k8sutil"
)
func (c *Cluster) Sync(stopCh <-chan struct{}) error {
func (c *Cluster) Sync() error {
c.mu.Lock()
defer c.mu.Unlock()
@@ -16,11 +16,6 @@ func (c *Cluster) Sync(stopCh <-chan struct{}) error {
c.logger.Errorf("could not load resources: %v", err)
}
if !c.podDispatcherRunning {
go c.podEventsDispatcher(stopCh)
c.podDispatcherRunning = true
}
c.logger.Debugf("Syncing secrets")
if err := c.syncSecrets(); err != nil {
if !k8sutil.ResourceAlreadyExists(err) {