Skip to content

Commit

Permalink
xds-server: Create informers before starting informer factory (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheahjs authored Nov 29, 2021
1 parent 8773320 commit 29b7350
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions xds/cmd/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ func createAgonesClusterProvider(
agonesClient,
0,
externalversions.WithNamespace(flags.GameServersNamespace))

gameServerLister := informerFactory.Agones().V1().GameServers().Lister()

informerFactory.Start(ctx.Done())

return agonescluster.NewProvider(logger, informerFactory.Agones().V1().GameServers().Lister(), agonescluster.Config{
return agonescluster.NewProvider(logger, gameServerLister, agonescluster.Config{
GameServersNamespace: flags.GameServersNamespace,
GameServersPollInterval: flags.GameServersPollInterval,
})
Expand All @@ -91,12 +94,15 @@ func createFilterChainProvider(
options.LabelSelector = k8sfilterchain.LabelSelectorProxyRole
}),
)

podLister := informerFactory.Core().V1().Pods().Lister()

informerFactory.Start(ctx.Done())

return k8sfilterchain.NewProvider(
logger,
clock.RealClock{},
informerFactory.Core().V1().Pods().Lister(),
podLister,
flags.ProxyPollInterval)
}

Expand Down

0 comments on commit 29b7350

Please sign in to comment.