Skip to content
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

Merged

Conversation

ironcladlou
Copy link
Contributor

@ironcladlou ironcladlou commented Apr 3, 2019

Before fc804a4 (#267), the cache.Informers interface methods returned
k8s.io/client-go/tools/cache.SharedIndexInformers 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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 3, 2019
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 3, 2019
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.
@ironcladlou
Copy link
Contributor Author

/retest

@ironcladlou
Copy link
Contributor Author

Guess there's no build bot — not sure what's up with the test failure. Second run passed. Flake?

@ironcladlou ironcladlou changed the title source: make the Informer source compatible with cache.Informer 🐛 source: make the Informer source compatible with cache.Informer Apr 4, 2019
@ironcladlou ironcladlou changed the title 🐛 source: make the Informer source compatible with cache.Informer 🐛source: make the Informer source compatible with cache.Informer Apr 4, 2019
@ironcladlou ironcladlou changed the title 🐛source: make the Informer source compatible with cache.Informer ✨ source: make the Informer source compatible with cache.Informer Apr 4, 2019
ironcladlou added a commit to ironcladlou/cluster-ingress-operator that referenced this pull request Apr 4, 2019
@DirectXMan12 DirectXMan12 changed the title ✨ source: make the Informer source compatible with cache.Informer ⚠️ source: make the Informer source compatible with cache.Informer Apr 5, 2019
@DirectXMan12
Copy link
Contributor

this is technically a breaking change (so I've fixed that) otherwise

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 5, 2019
@k8s-ci-robot
Copy link
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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 5, 2019
@DirectXMan12
Copy link
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).

@k8s-ci-robot k8s-ci-robot merged commit 0d6f672 into kubernetes-sigs:master Apr 5, 2019
@ironcladlou
Copy link
Contributor Author

Thank you!

DirectXMan12 pushed a commit that referenced this pull request Jan 31, 2020
Update how to run gitbhook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants