client-go/examples/fake-client
Haowei Cai 7dddf976b8 fix the fake client example: how to handle a race between the fake client and informer
Note that the fake client isn't designed to work with informer. It
doesn't support resource version. It's encouraged to use a real client
in an integration/E2E test if you need to test complex behavior with
informer/controllers.

Kubernetes-commit: 942bc9b32e39bb9c6ca045c02b48cc84dfa86633
2020-10-26 22:50:32 -07:00
..
doc.go client-go/examples/fake-client: add doc.go to fix go build warnings 2018-06-24 21:04:07 +05:30
main_test.go fix the fake client example: how to handle a race between the fake client and informer 2020-10-26 22:50:32 -07:00
README.md Add client-go example using fake client in test. 2018-06-20 18:35:57 -07:00

Fake Client Example

This example demonstrates how to use a fake client with SharedInformerFactory in tests.

It covers:

  • Creating the fake client
  • Setting up real informers
  • Injecting events into those informers

Running

go test -v k8s.io/client-go/examples/fake-client