Skip to content

Commit

Permalink
Update documentation for client-go informers
Browse files Browse the repository at this point in the history
- `manager.RunnableFunc` should block or it'll trigger shutdown.
- `source.Informer`'s `InformerProvider` field was renamed to `Informer`
  • Loading branch information
Martin Vladev committed Mar 18, 2019
1 parent e904181 commit 8476e7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/book/beyond_basics/using_client_go_informers.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ generatedInformers := kubeinformers.NewSharedInformerFactory(generatedClient, ti

err := mgr.Add(manager.RunnableFunc(func(s <-chan struct{}) error {
generatedInformers.Start(s)
<- s
return nil
}))
if err != nil {
Expand All @@ -50,7 +51,7 @@ The generated InformerFactory must be manually wired into the Controller creatio
```go
// Setup Watch using the client-go generated Informer
err := ctrl.Watch(
&source.Informer{InformerProvider: generatedInformers.Core().V1().Services()},
&source.Informer{Informer: generatedInformers.Core().V1().Services()},
&handler.EnqueueRequestForObject{},
)
if err != nil {
Expand Down

0 comments on commit 8476e7e

Please sign in to comment.