Skip to content

Commit

Permalink
Remove the WaitCacheSync block on informers
Browse files Browse the repository at this point in the history
The WaitForCacheSync waits forever and never returns in the case a
persisten error occurs. On the other hand, it looks like there is no
way in the current version of surfacing informer problems to the caller,
as stated in this issue: kubernetes/client-go#155.
Error handling for informers has been added recently in
kubernetes/kubernetes#87329 which is only available
in master for the moment.
  • Loading branch information
roivaz committed Apr 15, 2020
1 parent b0f6230 commit e8a8cec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions pkg/events/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package events

import (
"context"
"fmt"

"github.com/3scale/marin3r/pkg/reconciler"
"github.com/3scale/marin3r/pkg/util"
Expand Down Expand Up @@ -72,9 +71,6 @@ func (cmh *ConfigMapHandler) RunConfigMapHandler() error {
})
stopper := make(chan struct{})
go informer.Run(stopper)
if !cache.WaitForCacheSync(stopper, informer.HasSynced) {
return fmt.Errorf("Timed out waiting for caches to sync")
}

cmh.logger.Info("ConfigMap handler started")

Expand Down
4 changes: 0 additions & 4 deletions pkg/events/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package events

import (
"context"
"fmt"

"github.com/3scale/marin3r/pkg/reconciler"
"github.com/3scale/marin3r/pkg/util"
Expand Down Expand Up @@ -75,9 +74,6 @@ func (sr *SecretHandler) RunSecretHandler() error {
})
stopper := make(chan struct{})
go informer.Run(stopper)
if !cache.WaitForCacheSync(stopper, informer.HasSynced) {
return fmt.Errorf("Timed out waiting for caches to sync")
}

sr.logger.Info("Secret handler started")
<-sr.ctx.Done()
Expand Down

0 comments on commit e8a8cec

Please sign in to comment.