-
Notifications
You must be signed in to change notification settings - Fork 963
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
aggregate err when checking options #3586
Conversation
/assign @Monokaix @lowang-bh |
/PTAL thanks! |
// check controllers option | ||
var allErrors []error | ||
|
||
// Check controllers option | ||
if err := s.checkControllers(); err != 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.
Before this pr, err will return directly once checkControllers
has err, but after the change, other err will also be checked, which cause more code be executed, is this reasonable?
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.
IMO, this makes sense, because we are checking the options. The options should be checked as a whole and throw all errors, rather than throwing errors at each step.
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.
How about k8s's implements? Some time only the first error is need to be paid attention to.
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.
We can refer to the implementation of kube-scheduler. The configuration is returned only after the entire verification is completed. The same goes for other components
b25a22f
to
3f48a7a
Compare
Signed-off-by: googs1025 <[email protected]>
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
It is good to me.
If there are multiple errors, they can be detected on a single startup
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Monokaix 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 |
/kind feature