Skip to content

Commit

Permalink
Modify minMemory definition to 1 byte.
Browse files Browse the repository at this point in the history
Signed-off-by: jiangkaihua <jiangkaihua1@huawei.com>
  • Loading branch information
jiangkaihua committed Sep 27, 2020
1 parent 3b8662e commit 851c56d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/scheduler/api/resource_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (r *Resource) Clone() *Resource {

var minMilliCPU float64 = 10
var minMilliScalarResources float64 = 10
var minMemory float64 = 10 * 1024 * 1024
var minMemory float64 = 1

// NewResource create a new resource object from resource list
func NewResource(rl v1.ResourceList) *Resource {
Expand Down Expand Up @@ -186,7 +186,7 @@ func (r *Resource) SetMaxResource(rr *Resource) {
}
}

//FitDelta Computes the delta between a resource oject representing available
//FitDelta Computes the delta between a resource object representing available
//resources an operand representing resources being requested. Any
//field that is less than 0 after the operation represents an
//insufficient resource.
Expand Down
8 changes: 8 additions & 0 deletions pkg/scheduler/api/resource_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,14 @@ func TestLessEqual(t *testing.T) {
ScalarResources: map[v1.ResourceName]float64{"scalar.test/scalar1": 1},
},
resource2: &Resource{},
expected: false,
},
{
resource1: &Resource{
MilliCPU: 9,
Memory: 0,
},
resource2: &Resource{},
expected: true,
},
{
Expand Down

0 comments on commit 851c56d

Please sign in to comment.