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
⚠️ Support global controller options in component config #1371
⚠️ Support global controller options in component config #1371
Conversation
Need some feedback on this one :) |
/assign |
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 really good, couple of questions in the review but otherwise 👍
// Controller contains global configuration options for controllers | ||
// registered within this manager. | ||
// +optional | ||
Controller *ControllerConfigurationSpec `json:"controller,omitempty"` |
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.
In the description, you called this out as a breaking change but all the fields have optional? Am I missing something?
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 manager's interface new method addition is a breaking 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.
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.
Oh, I see. For the most part the docs (at least the ones in Kubebuilder on master
) point to embedding the core type so hopefully, anyone that has gone and implemented this would be able to receive the update to resolve this but for folks that aren't that makes sense. luckily we're still alpha 🎉
pkg/manager/manager.go
Outdated
@@ -407,6 +416,14 @@ func (o Options) AndFrom(loader config.ControllerManagerConfiguration) (Options, | |||
o.CertDir = newObj.Webhook.CertDir | |||
} | |||
|
|||
if o.Controller.CacheSyncTimeout == nil && newObj.Controller.CacheSyncTimeout != nil { |
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.
should we check if o.Controller
is nil
first?
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.
o.Controller is a non-pointer, to avoid checking it here
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.
oh gotcha, confused with the exported controllerconfiguration. makes sense.
// ControllerConfigurationSpec defines the global configuration for | ||
// controllers registered with the manager. | ||
type ControllerConfigurationSpec struct { | ||
// GroupKindConcurrency is a map from a Kind to the number of concurrent reconciliation |
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.
Love this idea, this will make it much easier to make per type configs.
/assign @alvaroaleman for another set of 👀 |
This change adds support for our v1alpha1 ComponentConfig types to expose configuration options for controllers. The only two current exposed options are concurrency (done via a GroupKind map) and the cache sync timeout option. This is a breaking change, given that we're adding a new required method to the Manager's interface. Signed-off-by: Vince Prignano <vincepri@vmware.com>
6a4d296
to
82fc256
Compare
@vincepri: The following test 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. |
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.
/lgtm
👍 to this, nice work!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christopherhein, vincepri 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 |
This change adds support for our v1alpha1 ComponentConfig types to
expose configuration options for controllers. The only two current
exposed options are concurrency (done via a GroupKind map) and the cache
sync timeout option.
This is a breaking change, given that we're adding a new required method
to the Manager's interface.
Signed-off-by: Vince Prignano vincepri@vmware.com