Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
events: log event kind being processed and disable resyncs (#4231)
Browse files Browse the repository at this point in the history
Logs event kind being processed by the message broker and
disabled the k8s period resyncs. The contoller reuses Ticker
for resyncs if necessary.

Signed-off-by: Shashank Ram <[email protected]>
  • Loading branch information
shashankram authored Oct 8, 2021
1 parent 9572b52 commit 09f4838
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/k8s/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const (

const (
// DefaultKubeEventResyncInterval is the default resync interval for k8s events
DefaultKubeEventResyncInterval = 5 * time.Minute
// This is set to 0 because we do not need resyncs from k8s client, and have our
// own Ticker to turn on periodic resyncs.
DefaultKubeEventResyncInterval = 0 * time.Second
)

// InformerKey stores the different Informers we keep for K8s resources
Expand Down
2 changes: 2 additions & 0 deletions pkg/messaging/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ func (b *Broker) run(stopCh <-chan struct{}) {
// 2. Processes other internal control plane events
// 3. Updates metrics associated with the event
func (b *Broker) processEvent(msg events.PubSubMessage) {
log.Trace().Msgf("Processing msg kind: %s", msg.Kind)
// Update proxies if applicable
if shouldUpdateProxy(msg) {
log.Trace().Msgf("Msg kind %s will update proxies", msg.Kind)
b.proxyUpdatePubSub.Pub(msg, announcements.ProxyUpdate.String())
metricsstore.DefaultMetricsStore.ProxyBroadcastEventCount.Inc()
}
Expand Down

0 comments on commit 09f4838

Please sign in to comment.