-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
⚠️ Add predicates as variadic args for Owns, For, and Watches func #799
Conversation
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.
The design looks much cleaner and extensible. 💯 Really great job!
/assign @DirectXMan12 @gerred
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12, mszostok 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 |
FYI, this'll prob mean some cherry-picking for the next v0.5.x release |
did we say that varargs are breaking changes and need to go into the next release? |
Yeah -- it changes the type signature. For instance, if you had |
Sounds good, I'll put a hold on this once we want to open master for v0.6. Given that there are a few PRs in flight for v0.5.x, I'm thinking we can wait for those to be merged, cut v0.5.1 and then open master to v0.6. /hold |
@@ -63,32 +63,62 @@ func (blder *Builder) ForType(apiType runtime.Object) *Builder { | |||
return blder.For(apiType) | |||
} | |||
|
|||
// ForInput represents the information set by For method. | |||
type ForInput struct { |
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.
Can we get away without exporting this type?
Likewise for OwnsInput
and WatchesInput
?
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.
If we want to allow custom implementations of options (which is nice), this has to be public
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.
Ah, so that others can implement ForOption.ApplyToFor
and company. I see.
/hold cancel |
/lgtm |
Description
Predicate
. Watches, Owns, For, and WatchesImplemented with Functional Options pattern as described here: #602 (comment)
I decided to go with
Input
struct for each method to have separation and make those methods independent of each other.Fixes: #572