⚠️ source: make the Informer source compatible with cache.Informer#383
Merged
k8s-ci-robot merged 1 commit intoApr 5, 2019
Merged
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
Contributor
Author
|
/retest |
Contributor
Author
|
Guess there's no build bot — not sure what's up with the test failure. Second run passed. Flake? |
ironcladlou
added a commit
to ironcladlou/cluster-ingress-operator
that referenced
this pull request
Apr 4, 2019
Can be reverted if kubernetes-sigs/controller-runtime#383 merges.
Contributor
|
this is technically a breaking change (so I've fixed that) otherwise /lgtm |
Contributor
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
|
(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). |
Contributor
Author
|
Thank you! |
DirectXMan12
pushed a commit
that referenced
this pull request
Jan 31, 2020
Update how to run gitbhook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before fc804a4 (#267), the
cache.Informersinterface methods returnedk8s.io/client-go/tools/cache.SharedIndexInformers which were by defaultcompatible with the built-in
source.Informer. Users could create arbitrarycache.Cacheinstances (or get them from theManager) and then usecontroller.Watchto drive a controller with asource.Informerfrom thecache.Cache.With fc804a4, the
cache.Informersinterface was changed to returncache.Informerinstances; however,source.Informerwas not updated to accepta
cache.Informer, and so users can no longer use the built-insource.Informerwithcache.Cache.The
cache.Informerinterface appears to satisfy the needs ofsource.Informer. This commit broadenssource.Informerto accept acache.Informer, restoring the prior capability while remaining compatiblewith
SharedIndexInformeruse.