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
[controller-manager] Switch Bastion
controller to controller-runtime
and introduce common indexers
#6358
[controller-manager] Switch Bastion
controller to controller-runtime
and introduce common indexers
#6358
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.
Very nice PR! I just have a few questions.
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.
Shouldn't we create unit tests for pkg/api/indexer
as it is a new package now? 😅
7325298
to
804b367
Compare
/assign |
Otherwise, IDEs might show an error that we don't import these packages "correctly". Co-Authored-By: Tim Ebert <tim.ebert@sap.com>
This way, they will become reusable (e.g. for integration tests, see next commit). Co-Authored-By: Tim Ebert <tim.ebert@sap.com>
Co-Authored-By: Tim Ebert <tim.ebert@sap.com>
This makes it easier to construct functions which can be casted via `mapper.MapFunc` to the `mapper.Mapper` interface (see next commit). Co-Authored-By: Tim Ebert <tim.ebert@sap.com>
Co-Authored-By: Tim Ebert <tim.ebert@sap.com>
same as in a173f8a
This allows us to use one manager for all cases (next commit)
804b367
to
e55398e
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.
Not completely through yet
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 is my remaining feedback
I have finished my review and pushed a few more commits addressing the open suggestions. |
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 scope of this PR is now a bit bigger than its name and description suggests.
Maybe it is worth mentioning that the new common indexer functions are used by gardenlet too.
Bastion
controller to controller-runtime
Bastion
controller to controller-runtime
and introduce common indexers
@oliver-goetz @plkokanov thanks for your feedback, PTAL :) |
@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 on my side |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: timebertt 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 |
@@ -189,3 +209,60 @@ var _ = Describe("Add", func() { | |||
}) | |||
}) | |||
}) | |||
|
|||
// TODO: remove this again once the controller-runtime fake client supports field selectors |
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.
Is there already a PR for it or can you open one with this code? :)
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.
Unfortunately, there is no PR for this upstream yet, AFAIK.
This will probably involve some design discussion, so expect some delay. But I will try my best :)
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.
😄 Okay, thank you!
/milestone v1.52 |
Bastion
controller to controller-runtime
and introduce common indexersBastion
controller to controller-runtime
and introduce common indexers
How to categorize this PR?
/area dev-productivity scalability
/kind enhancement
What this PR does / why we need it:
Refactor the
Bastion
controller tocontroller-runtime
.Also, introduce a new
pkg/api/indexer
package which hosts functions for adding field indexes to the controller-runtime cache.The package is commonly used by controller-manager, gardenlet and integration tests, so that we can add indexes in symmetry and without duplication.
Partly co-authored by @timebertt.
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
controller-runtime
Release note: