-
Notifications
You must be signed in to change notification settings - Fork 15
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
✨ Prepare context with cluster #55
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @aaronjwood. Thanks for your PR. I'm waiting for a kcp-dev 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. |
4a8d4eb
to
73900a3
Compare
Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits. 📝 Please follow instructions in the contributing guide to update your commits with the DCO Full details of the Developer Certificate of Origin can be found at developercertificate.org. The list of commits missing DCO signoff:
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. I understand the commands that are listed here. |
Hey @aaronjwood, thank you for your contribution! I totally see that the two lines in question feel repetitive, but I am concerned that we are diverging from upstream then. In addition, you can use this controller-runtime fork against non-kcp environments as well (and that's intended, as you might have a mixture of talking to kcp and to vanilla Kubernetes on different sides), and I'm not sure that injecting the cluster key into context unconditionally is a good idea. @sttts WDYT? |
How about https://github.com/kcp-dev/controller-runtime/blob/kcp-0.17/pkg/kcp/helper.go#L29 ? Keeps it out of the actual reconciler. Am also a little hesitent to introduce too much magic, especially in the light of kubernetes-sigs#2726. |
Thanks for the review guys. I'm fine to close this if it's not the direction we want to go. Just so I understand, when we say we're diverging from upstream with this, how is it different from 'ClusterName |
Upstream will follow a |
I see, thanks. I'll close this out. |
The goal of this is to have the context ready to be used by the time
Reconcile
is called on a controller. I've been seeing lots of code like this:I don't see why controllers need to do this over and over. With the context having the cluster set this repetitive boilerplate can be eliminated to something like: