-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚠️ source: make the Informer source compatible with cache.Informer #383
⚠️ source: make the Informer source compatible with cache.Informer #383
Conversation
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.
b2aef81
to
bb84391
Compare
/retest |
Guess there's no build bot — not sure what's up with the test failure. Second run passed. Flake? |
Can be reverted if kubernetes-sigs/controller-runtime#383 merges.
this is technically a breaking change (so I've fixed that) otherwise /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12, ironcladlou The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
(we've been getting intermittent flakes. based on a conversion I had the other day, it might actually be a now-fixed bug in kube-apiserver). |
Thank you! |
Update how to run gitbhook
Before fc804a4 (#267), the
cache.Informers
interface methods returnedk8s.io/client-go/tools/cache.SharedIndexInformer
s which were by defaultcompatible with the built-in
source.Informer
. Users could create arbitrarycache.Cache
instances (or get them from theManager
) and then usecontroller.Watch
to drive a controller with asource.Informer
from thecache.Cache
.With fc804a4, the
cache.Informers
interface was changed to returncache.Informer
instances; however,source.Informer
was not updated to accepta
cache.Informer
, and so users can no longer use the built-insource.Informer
withcache.Cache
.The
cache.Informer
interface appears to satisfy the needs ofsource.Informer
. This commit broadenssource.Informer
to accept acache.Informer
, restoring the prior capability while remaining compatiblewith
SharedIndexInformer
use.