-
Notifications
You must be signed in to change notification settings - Fork 906
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
reduce function calling #3540
reduce function calling #3540
Conversation
Signed-off-by: lowang-bh <[email protected]>
@lowang-bh: The label(s) In response to this:
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. |
@@ -336,8 +336,9 @@ func (p TasksPriority) CalcPGMinResources(jobMinAvailable int32) v1.ResourceList | |||
// calTaskRequests returns requests resource with validReplica replicas | |||
func calTaskRequests(pod *v1.Pod, validReplica int32) v1.ResourceList { | |||
minReq := v1.ResourceList{} | |||
usage := *util.GetPodQuotaUsage(pod) | |||
for i := int32(0); i < validReplica; i++ { |
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.
If validReplica
length=0, then util.GetPodQuotaUsage(pod)
will not be called, but after this pr, it will always be called, is this feasible?
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.
validReplica
will nearly never be zero. So most cases GetPodQuotaUsage
will only be called once. Even though it is zero, the logic is ok and has no other impact.
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.
OK.
/lgtm |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hwdef 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 cleanup