Skip to content
This repository has been archived by the owner on Jul 7, 2019. It is now read-only.

Commit

Permalink
Cleanup unsed codes
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLike committed May 15, 2019
1 parent 0f36bc1 commit 3b939e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
1 change: 0 additions & 1 deletion hack/.golint_failures
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ pkg/scheduler/actions/backfill
pkg/scheduler/actions/enqueue
pkg/scheduler/actions/preempt
pkg/scheduler/actions/reclaim
pkg/scheduler/api
test/e2e
16 changes: 2 additions & 14 deletions pkg/scheduler/api/resource_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import (
"fmt"
"math"

"k8s.io/apimachinery/pkg/api/resource"

v1 "k8s.io/api/core/v1"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
)
Expand Down Expand Up @@ -83,6 +81,7 @@ func NewResource(rl v1.ResourceList) *Resource {
case v1.ResourcePods:
r.MaxTaskNum += int(rQuant.Value())
default:
//NOTE: When converting this back to k8s resource, we need record the format as well as / 1000
if v1helper.IsScalarResourceName(rName) {
r.AddScalar(rName, float64(rQuant.MilliValue()))
}
Expand Down Expand Up @@ -157,7 +156,7 @@ func (r *Resource) Sub(rr *Resource) *Resource {
return r
}

panic(fmt.Errorf("Resource is not sufficient to do operation: <%v> sub <%v>",
panic(fmt.Errorf("resource is not sufficient to do operation: <%v> sub <%v>",
r, rr))
}

Expand Down Expand Up @@ -326,14 +325,3 @@ func (r *Resource) SetScalar(name v1.ResourceName, quantity float64) {
}
r.ScalarResources[name] = quantity
}

func (r *Resource) Convert2K8sResource() *v1.ResourceList {

This comment has been minimized.

Copy link
@asifdxtreme

asifdxtreme May 15, 2019

This function is used by Volcano

list := v1.ResourceList{
v1.ResourceCPU: *resource.NewMilliQuantity(int64(r.MilliCPU), resource.DecimalSI),
v1.ResourceMemory: *resource.NewQuantity(int64(r.Memory), resource.BinarySI),
}
for name, value := range r.ScalarResources {
list[name] = *resource.NewQuantity(int64(value), resource.BinarySI)
}
return &list
}

0 comments on commit 3b939e2

Please sign in to comment.