-
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
🐛 controllers without For() fail to start #2105
Conversation
|
Welcome @tsuzu! |
Hi @tsuzu. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
src := &source.Kind{Type: typeForSrc} | ||
hdler := &handler.EnqueueRequestForObject{} | ||
allPredicates := append(blder.globalPredicates, blder.forInput.predicates...) | ||
if err := blder.ctrl.Watch(src, hdler, allPredicates...); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for this, for example by checking how often ctrl.Watch
gets called
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a fake controller.Controller
is difficult for me.
Instead, I added a test with doReconcileTest
.
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, tsuzu 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 |
/cherrypick release-0.14 |
@alvaroaleman: once the present PR merges, I will cherry-pick it on top of release-0.14 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@alvaroaleman: new pull request created: #2108 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes #2101
When calling
Builder.Complete()
withoutFor
,blder.forInput.object
is nil.If
source.Kind
with nil Type is passed to Watch(), it results inmust specify Kind.Type
error atcontroller-runtime/pkg/source/source.go
Line 116 in 69f0938