-
Notifications
You must be signed in to change notification settings - Fork 105
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-runtime: enable ability to fetch controller runtime client #156
controller-runtime: enable ability to fetch controller runtime client #156
Conversation
Hi @harshanarayana. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
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 prompt PR.
I left couple of comments.
@@ -38,6 +40,12 @@ type client struct { | |||
resources *resources.Resources | |||
} | |||
|
|||
// NewControllerRuntimeClient provides an instance of the Controller runtime client with | |||
// the provided rest config and custom runtime scheme. | |||
func NewControllerRuntimeClient(cfg *rest.Config, scheme *runtime.Scheme) (cr.Client, error) { |
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 am not sure if this is needed. What I do think is needed is a way to inject an existing Controller Runtime client to be used be used with Resources:
func (r *Resources) SetCRClient(c cr.Client) {
r.client = c
}
Or something like that
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.
@vladimirvivien THis might break a few things if we are not careful possibly ?
type Resources struct {
config *rest.Config
scheme *runtime.Scheme
client cr.Client
namespace string
}
If we are to override the Resources.client
should we allow the same for Resources.config
if so, how do we enforce that? Document it and hope everyone will read and keep that in mind ? Might get a bit messy is it not ?
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 think we should not let someone set the Resources.Client
directly. Instead, use the klient/client.go
method to create a new resource for custom config or use the GetControllerRuntimeClient
function from the Resources
to access the already existing client. That way, we can keep this clean.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
8a3002f
to
4c11350
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 good to me. Thanks @harshanarayana
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: harshanarayana, vladimirvivien 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 does this do ?
Enable the ability to fetch the reusable controller-runtime client via the
e2e-framework
infra.Why is this required?
#146 (comment) Has a good explanation on the usability of this features.
Fixes #146