Skip to content

Commit e556b49

Browse files
authored
Merge pull request #726 from googs1025/master
fix log print and some nit issue
2 parents d9728ed + b95c9ba commit e556b49

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

pkg/capacityscheduling/capacity_scheduling.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func (p *preemptor) PodEligibleToPreemptOthers(pod *v1.Pod, nominatedNodeStatus
406406

407407
preFilterState, err := getPreFilterState(p.state)
408408
if err != nil {
409-
klog.ErrorS(err, "Failed to read preFilterState from cycleState", "preFilterStateKey", preFilterStateKey)
409+
klog.V(5).InfoS("Failed to read preFilterState from cycleState, err: %s", err, "preFilterStateKey", preFilterStateKey)
410410
return false, "not eligible due to failed to read from cycleState"
411411
}
412412

pkg/noderesourcetopology/cache/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type Interface interface {
6363

6464
// PostBind is called after a pod is successfully bound. These plugins are
6565
// informational. A common application of this extension point is for cleaning
66-
// up. If a plugin needs to clean-up its state after a pod is scheduled and
66+
// up. If a plugin needs to clean up its state after a pod is scheduled and
6767
// bound, PostBind is the extension point that it should register.
6868
PostBind(nodeName string, pod *corev1.Pod)
6969
}

pkg/podstate/pod_state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (ps *PodState) NormalizeScore(ctx context.Context, state *framework.CycleSt
8282
}
8383
}
8484

85-
// Transform the highest to lowest score range to fit the framework's min to max node score range.
85+
// Transform the highest to the lowest score range to fit the framework's min to max node score range.
8686
oldRange := highest - lowest
8787
newRange := framework.MaxNodeScore - framework.MinNodeScore
8888
for i, nodeScore := range scores {

pkg/sysched/sysched_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
v1 "k8s.io/api/core/v1"
99
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1010
"k8s.io/apimachinery/pkg/runtime"
11+
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
1112
"k8s.io/apimachinery/pkg/util/sets"
1213
"k8s.io/client-go/informers"
1314
clientsetfake "k8s.io/client-go/kubernetes/fake"
@@ -492,8 +493,7 @@ func TestGetHostSyscalls(t *testing.T) {
492493
}
493494

494495
func TestUpdateHostSyscalls(t *testing.T) {
495-
v1beta1.AddToScheme(clientscheme.Scheme)
496-
496+
utilruntime.Must(v1beta1.AddToScheme(clientscheme.Scheme))
497497
tests := []struct {
498498
name string
499499
nodes []*v1.Node

pkg/trimaran/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Currently, the collection consists of the following plugins.
77

88
- `TargetLoadPacking`: Implements a packing policy up to a configured CPU utilization, then switches to a spreading policy among the hot nodes. (Supports CPU resource.)
99
- `LoadVariationRiskBalancing`: Equalizes the risk, defined as a combined measure of average utilization and variation in utilization, among nodes. (Supports CPU and memory resources.)
10-
- `LowRiskOverCommitment`: Evaluates the performance risk of overcommitment and selects the node with lowest risk by taking into consideration (1) the resource limit values of pods (limit-aware) and (2) the actual load (utilization) on the nodes (load-aware). Thus, it provides a low risk environment for pods and alleviate issues with overcommitment, while allowing pods to use their limits.
10+
- `LowRiskOverCommitment`: Evaluates the performance risk of overcommitment and selects the node with the lowest risk by taking into consideration (1) the resource limit values of pods (limit-aware) and (2) the actual load (utilization) on the nodes (load-aware). Thus, it provides a low risk environment for pods and alleviate issues with overcommitment, while allowing pods to use their limits.
1111

1212
The Trimaran plugins utilize a [load-watcher](https://github.com/paypal/load-watcher) to access resource utilization data via metrics providers. Currently, the `load-watcher` supports three metrics providers: [Kubernetes Metrics Server](https://github.com/kubernetes-sigs/metrics-server), [Prometheus Server](https://prometheus.io/), and [SignalFx](https://docs.signalfx.com/en/latest/integrations/agent/index.html).
1313

pkg/trimaran/targetloadpacking/targetloadpacking.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,12 @@ func (pl *TargetLoadPacking) NormalizeScore(context.Context, *framework.CycleSta
193193
return nil
194194
}
195195

196-
// Predict utilization for a container based on its requests/limits
196+
// PredictUtilisation predict utilization for a container based on its requests/limits
197197
func PredictUtilisation(container *v1.Container) int64 {
198198
if _, ok := container.Resources.Limits[v1.ResourceCPU]; ok {
199199
return container.Resources.Limits.Cpu().MilliValue()
200200
} else if _, ok := container.Resources.Requests[v1.ResourceCPU]; ok {
201201
return int64(math.Round(float64(container.Resources.Requests.Cpu().MilliValue()) * requestsMultiplier))
202-
} else {
203-
return requestsMilliCores
204202
}
203+
return requestsMilliCores
205204
}

0 commit comments

Comments
 (0)