-
Notifications
You must be signed in to change notification settings - Fork 994
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 Resource Less/LessEqual #484
Conversation
Travis tests have failedHey @wangyuqing4, TravisBuddy Request Identifier: 604118b0-efec-11e9-983c-41f05746e0df |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: k82cn, wangyuqing4 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 |
Hey @wangyuqing4, TravisBuddy Request Identifier: 576518a0-eff5-11e9-983c-41f05746e0df |
@@ -278,7 +278,7 @@ func TestLessEqual(t *testing.T) { | |||
ScalarResources: map[v1.ResourceName]float64{"scalar.test/scalar1": 1}, | |||
}, | |||
resource2: &Resource{}, | |||
expected: false, | |||
expected: true, |
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.
resource1 < resource2
in this 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.
yes, resource1.ScalarResources map is not nil, but value <= minMilliScalarResources, so continue, point 4
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 the others, e.g. cpu, memory? we need to make sure all resources meet LessEqual
.
/lgtm cancel |
/lgtm Thanks :) |
Cherry picked from volcano-sh/volcano#484.
when i use job.yaml
on nodes like this
i use kubectl create -f job.yaml, but no pods were scheduled.
pod events:
i read func Less/LessEqual very confused, so i edit
func Less, if map r.ScalarResources and rr.ScalarResources are all nil, i think should not compare, should according to cpu and memory.
func Less, if map r.ScalarResources nil, rr.ScalarResources is not nil and value <= minMilliScalarResources, i think is not less, should return false. in other words, rr.ScalarResources should large enough if map is not nil.