Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
source: make the Informer source compatible with cache.Informer
Before fc804a4 (kubernetes-sigs#267), the `cache.Informers` interface methods returned `k8s.io/client-go/tools/cache.SharedIndexInformer`s which were by default compatible with the built-in `source.Informer`. Users could create arbitrary `cache.Cache` instances (or get them from the `Manager`) and then use `controller.Watch` to drive a controller with a `source.Informer` from the `cache.Cache`. With fc804a4, the `cache.Informers` interface was changed to return `cache.Informer` instances; however, `source.Informer` was not updated to accept a `cache.Informer`, and so users can no longer use the built-in `source.Informer` with `cache.Cache`. The `cache.Informer` interface appears to satisfy the needs of `source.Informer`. This commit broadens `source.Informer` to accept a `cache.Informer`, restoring the prior capability while remaining compatible with `SharedIndexInformer` use.
- Loading branch information