Skip to content
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

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

googs1025
Copy link
Member

/kind feature

  • aggregate err when checking options

@volcano-sh-bot volcano-sh-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 14, 2024
@volcano-sh-bot volcano-sh-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 14, 2024
@googs1025
Copy link
Member Author

/assign @Monokaix @lowang-bh

@googs1025
Copy link
Member Author

/PTAL thanks!

// check controllers option
var allErrors []error

// Check controllers option
if err := s.checkControllers(); err != nil {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-scheduler/app/options/options.go#L267

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

@googs1025 googs1025 force-pushed the aggregate_err branch 2 times, most recently from b25a22f to 3f48a7a Compare July 27, 2024 01:06
@googs1025 googs1025 requested a review from Monokaix July 27, 2024 01:06
Copy link
Member

@hwdef hwdef left a 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

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2024
@Monokaix
Copy link
Member

Monokaix commented Aug 6, 2024

/approve

@volcano-sh-bot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 6, 2024
@volcano-sh-bot volcano-sh-bot merged commit 4607119 into volcano-sh:master Aug 6, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants