-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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 validation for percentage-of-nodes-to-score of the scheduler config #69355
Conversation
/kind bug |
@@ -58,7 +58,8 @@ func TestValidateKubeSchedulerConfiguration(t *testing.T) { | |||
RetryPeriod: metav1.Duration{Duration: 5 * time.Second}, | |||
}, | |||
}, | |||
BindTimeoutSeconds: &testTimeout, | |||
BindTimeoutSeconds: &testTimeout, | |||
PercentageOfNodesToScore: 35, |
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.
Curious about 35. Was it chosen randomly :P ?
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.
Yes. Just a valid number (between 0 and 100) to test our validation.
@@ -136,6 +140,10 @@ func TestValidateKubeSchedulerConfiguration(t *testing.T) { | |||
expectedToFail: true, | |||
config: bindTimeoutUnset, | |||
}, | |||
"bad-percentage-of-nodes-to-score": { | |||
expectedToFail: true, | |||
config: percentageOfNodesToScore101, |
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.
Probably a positive test case as well?
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 positive test case exists. It is labeled as "good" in the switch statement. The number 35 that I have added above is for the valid case.
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.
Ohh sorry github UI wasn't showing as it wasn't a new change, so did not notice. Thanks.
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 @bsalamat. Do you want to cherrypick this to 1.12, if the config validation is available in that release?
/retest |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bsalamat, ravisantoshgudimetla 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 this PR does / why we need it:
The config validation for the scheduler was added almost at the same time we added "percentage-of-nodes-to-score". So, it was missing in the validation logic. This PR adds the validation.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Release note:
/sig scheduling