-
Notifications
You must be signed in to change notification settings - Fork 463
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
[gardenlet] Switch ControllerInstallation
controller to controller-runtime
#6733
Conversation
/test pull-gardener-e2e-kind |
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 for the well structured PR.
Generally looks good.
/needs-second-opinion
pkg/gardenlet/controller/controllerinstallation/care/reconciler.go
Outdated
Show resolved
Hide resolved
/assign |
26bf6e3
to
b3aeaff
Compare
@shafeeqes @ary1992 The PR is rebased and the feedback is addressed, please check it out again. |
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 went through the PR again, found only one minor nit.
Otherwise, lgtm.
pkg/gardenlet/controller/controllerinstallation/controllerinstallation/add.go
Outdated
Show resolved
Hide resolved
b3aeaff
to
06c965f
Compare
/lgtm |
06c965f
to
c38c6f6
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.
Thank you for the PR!
Just minor nits.
pkg/gardenlet/controller/controllerinstallation/care/reconciler.go
Outdated
Show resolved
Hide resolved
pkg/gardenlet/controller/controllerinstallation/care/reconciler.go
Outdated
Show resolved
Hide resolved
…ache This way, we don't have to filter unrelated `ControllerInstallation`s at the controller level (e.g., with predicates). The underlying controller-runtime cache already makes sure that we only see objects which are related to our seed now.
Without this, the field selector watch for the gardenlet does not work.
Similar to other refactored care controllers. Now we can properly/cleanly handle and return errors occuring during reconciliation.
The main `ControllerInstallation` controller now adds a label to the created `ManagedResource` in the seed so that the care controller can map the `ManagedResource` to the owning `ControllerInstallation`. Also, the predicate about changed conditions from the seed's `ExtensionsCheck` controller was moved to the general predicate utils so that it can be reused in the care controller now.
c38c6f6
to
b0fd081
Compare
ref #6642 (comment) /test pull-gardener-integration |
b0fd081
to
ca2b1f0
Compare
@rfranzke: The following test failed, say
Full PR test history. Your PR dashboard. Command help for this repository. 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. |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rfranzke 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 |
How to categorize this PR?
/area dev-productivity scalability
/kind enhancement
What this PR does / why we need it:
Refactor the
ControllerInstallation
controller tocontroller-runtime
. It consists of several reconcilers, so there are some empty separator commits to allow easy navigation through the PR.Also, we are now filtering the cache at manager/cluster level already. This way, we ensure that the gardenlet only sees
ControllerInstallation
s which are related to theSeed
it is responsible for. This allows us to drop the custom filtering in the controllers event handlers. It also reduces memory usage of the gardenlet.Which issue(s) this PR fixes:
Part of #4251
Special notes for your reviewer:
Generally, we want to follow this cookbook while refactoring existing controllers:
envtest
(if not already present)controller-runtime
Release note: