-
Notifications
You must be signed in to change notification settings - Fork 39.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
Fix GPU resource validation #28743
Fix GPU resource validation #28743
Conversation
Removing label |
// For GPUs, require that no request be set. | ||
if resourceName == api.ResourceNvidiaGPU { | ||
allErrs = append(allErrs, field.Invalid(reqPath, requestQuantity.String(), "cannot be set")) | ||
// For GPUs, require that `requests` never be less than `limits`. |
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.
Does comment above match code below?
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.
Well, for all resources it's already the case that a request can't exceed the limit. In this case, we also require for it to never be less than the limit, either. Perhaps I should reword the comment to make that clearer.
Because of defaulting, requests are always set if limits are. Thus, the check can never succeed. Instead, make sure that the two values are equal. Also, remove a few other error messages and remove unnecessary Sprintf calls.
Fixed comment and rebased |
@erictune anything else that should be taken care of? I want to pester the 1.3 release shepard for a 1.3.1 cherry-pick, but first I need to get a fix in. Thanks! |
LGTM |
@k8s-bot test this: github issue #IGNORE |
1 similar comment
GCE e2e build/test passed for commit b86dfcf. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit b86dfcf. |
Automatic merge from submit-queue |
Yay. @erictune would you be able to re-add the |
@therc Cherrypick approved. Please create a cherrypick PR. Thanks. |
@therc Oops, sorry, just noticed the PR. Please ignore last request. Thanks. |
Commit found in the "release-1.3" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
…ck-of-#28743-upstream-release-1.3 Automatic merge from submit-queue Automated cherry pick of kubernetes#28743 Cherry pick of kubernetes#28743 on release-1.3.
This fixes scheduling of pods with GPU resources. The change was never upstreamed during the 1.3 beta period, as it got lost in the noise of other changes in our fork. Ooops. I'll submit a cherry-pick request for 1.3.1 as soon as this lands in master.
Because of defaulting, requests are always set if limits are. Thus, the check can never succeed. Instead, make sure that the two values are equal.
Also, remove a few other error messages and remove unnecessary Sprintf calls.