-
Notifications
You must be signed in to change notification settings - Fork 971
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 config field to the ControllerOption #3615
Add config field to the ControllerOption #3615
Conversation
@@ -37,6 +38,8 @@ type ControllerOption struct { | |||
InheritOwnerAnnotations bool | |||
WorkerThreadsForPG uint32 | |||
WorkerThreadsForGC uint32 | |||
|
|||
Config *rest.Config |
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.
Why do we need this change?
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.
Do you have any plans or what the custom client needs?
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 add some comments to describe why is this needed and what does it aim to do is better: ) @liuyuanchun11
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.
Sorry for not explaining clearly. I am maintaining a project based on the volcano community version, which contains some custom resource controllers and plug-ins, etc. Now I need to add a custom resource clientset, similar to VolcanoClient. The clientset of this custom resource is obviously not suitable to be placed in the ControllerOption structure, so I want to put rest.Config in the ControllerOption, so that it can be passed to my new controller, and then call NewForConfigOrDie(config) to generate clientset
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.
Will the maintained features be fed back to the community? IMO, there is no need to introduce unused variables.
Just my opinion.If it is an overall feature, it feels more reasonable to introduce this variable
a250091
to
e59993b
Compare
@@ -37,6 +38,9 @@ type ControllerOption struct { | |||
InheritOwnerAnnotations bool | |||
WorkerThreadsForPG uint32 | |||
WorkerThreadsForGC uint32 | |||
|
|||
// Config holds the common attributes that can be passed to a Kubernetes client on initialization. |
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.
Kubernetes client on initialization. =》Kubernetes client and controllers registered by the users can use it.
e59993b
to
f021326
Compare
/lgtm |
f021326
to
bb3fb34
Compare
95dd451
to
9addcf9
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: william-wang 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 |
Signed-off-by: liuyuanchun <[email protected]>
9addcf9
to
9daf618
Compare
/lgtm |
Add config field to the ControllerOption, pass the config parameter to the controllers, and the controllers can use config to create a custom clientset