-
Notifications
You must be signed in to change notification settings - Fork 1.2k
⚠️ Handler: Remove MapObject type and use client.Object directly #1207
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
⚠️ Handler: Remove MapObject type and use client.Object directly #1207
Conversation
We updated the handlers MapObject type to not include a metav1.Object and a runtime.Object representation of the same object but instead a client.Object, which is a union of the two above. The only reason for the MapObject type to exist in the first place though was to hold these two fields. Now that there is only the client.Object left, we can use that directly and get rid of the MapObject type.
@alvaroaleman: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
@@ -65,15 +66,15 @@ func ExampleEnqueueRequestsFromMapFunc() { | |||
// controller is a controller.controller | |||
err := c.Watch( | |||
&source.Kind{Type: &appsv1.Deployment{}}, | |||
handler.EnqueueRequestsFromMapFunc(func(a handler.MapObject) []reconcile.Request { | |||
handler.EnqueueRequestsFromMapFunc(func(a client.Object) []reconcile.Request { |
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.
This example basically shows how this makes things easier
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.
/approve
/lgtm
/milestone v0.7.x
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, vincepri 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 |
This updates our controllers to work with recent controller runtime updates (Simplify usage of EnqueueRequestsFromMapFunc, and Remove MapObject type and use client.Object directly): - kubernetes-sigs/controller-runtime#1119 - kubernetes-sigs/controller-runtime#1207
This updates our controllers to work with recent controller runtime updates (Simplify usage of EnqueueRequestsFromMapFunc, and Remove MapObject type and use client.Object directly): - kubernetes-sigs/controller-runtime#1119 - kubernetes-sigs/controller-runtime#1207
We updated the handlers MapObject type to not include a metav1.Object
and a runtime.Object representation of the same object but instead a
client.Object, which is a union of the two above.
The only reason for the MapObject type to exist in the first place
though was to hold these two fields. Now that there is only the
client.Object left, we can use that directly and get rid of the
MapObject type.