-
Notifications
You must be signed in to change notification settings - Fork 41.8k
Migrate cluster role aggregator to apply #99462
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
Migrate cluster role aggregator to apply #99462
Conversation
ab14069 to
c1e72d2
Compare
|
/triage accepted |
c1e72d2 to
7c64054
Compare
7c64054 to
bb3737d
Compare
|
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
bb3737d to
4d08f96
Compare
apelisse
left a comment
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.
Looks good to me.
pkg/controller/clusterroleaggregation/clusterroleaggregation_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/clusterroleaggregation/clusterroleaggregation_controller.go
Outdated
Show resolved
Hide resolved
10e4339 to
1e58ee3
Compare
|
@jpbetz: The following tests 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. |
|
/test pull-kubernetes-unit |
|
/retest |
pkg/controller/clusterroleaggregation/clusterroleaggregation_controller.go
Outdated
Show resolved
Hide resolved
1e58ee3 to
b361c03
Compare
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 looks like a problem worth fixing.
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.
Yeah, this is an interesting problem I hit. I chatted with a few people out-of-band about this.
Because server-side apply is implemented in the apiserver (see fieldmanager), this looks really difficult to full address (intractable?). It is maybe slightly more tractable now that we have the SMD schemas loaded into the client, but still a large problem. I've opened an issue to track: #99953 with some notes about what we might be able to do (and what makes full support so difficult). Okay to look at this as a follow up to GA? I don't think we're going to be able to do much in the short term :(
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.
It's difficult to recommend people use a shiny new client for their controllers if they are unable to easily unit test the code that they author. If we cannot recommend that people use the new GA feature, is it truly GA? Is there a pattern they can use in the interim?
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.
I've spent some time reviewing use cases and trying to come up with a recommendation. See client-go Apply Fake Client: Review of use cases for a lot more detail. There seem to be 4 main uses cases to consider:
- "Simulate responses to requests (via Reactors)" - works fine
- "Validate the requests made using the client" - I think this is where we should focus short term efforts
- "Simulate external changes to objects" - works fine
- "Using objectTracker as a pretend apiserver" - looks like an anti-pattern, found very few tests doing this
I think we can get the "Validate the requests made using the client" fixed with a relatively small change in the near term.
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.
I'd like to have the apply fake client be at least as good as the update fake client is today. It certainly needs to detect when cases aren't working right as a minimum bar.
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.
I thought we were reserving at least a release in case we find a significant usability problem for which we want to break compatibility. I think it's OK if the fake client isn't feature-complete while in this state, but the comments for the generated fakes should make it clear what works and what doesn't.
pkg/controller/clusterroleaggregation/clusterroleaggregation_controller.go
Outdated
Show resolved
Hide resolved
b361c03 to
0aa6c80
Compare
pkg/controller/clusterroleaggregation/clusterroleaggregation_controller.go
Outdated
Show resolved
Hide resolved
0aa6c80 to
96a9f17
Compare
96a9f17 to
24f9566
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, jpbetz 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Migrates one controller over to use the client-go support for server apply. This is something we had agreed to do as part of the KEP for Apply for client-go's typed client
umbrella issue: kubernetes/enhancements#2155
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Release note will be added when all the last change in the umbrella issue is merged
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/sig api-machinery
/wg api-expression