Skip to content

Commit 01ec210

Browse files
authored
Merge pull request #492 from Fish-pro/chore/unused
Clean up unused variables and functions
2 parents f899c84 + d169bd6 commit 01ec210

File tree

6 files changed

+0
-83
lines changed

6 files changed

+0
-83
lines changed

pkg/capacityscheduling/capacity_scheduling.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -793,13 +793,6 @@ func getPDBLister(informerFactory informers.SharedInformerFactory) policylisters
793793
return informerFactory.Policy().V1().PodDisruptionBudgets().Lister()
794794
}
795795

796-
func getPodDisruptionBudgets(pdbLister policylisters.PodDisruptionBudgetLister) ([]*policy.PodDisruptionBudget, error) {
797-
if pdbLister != nil {
798-
return pdbLister.List(labels.Everything())
799-
}
800-
return nil, nil
801-
}
802-
803796
// computePodResourceRequest returns a framework.Resource that covers the largest
804797
// width in each resource dimension. Because init-containers run sequentially, we collect
805798
// the max in each dimension iteratively. In contrast, we sum the resource vectors for

pkg/coscheduling/core/core.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ type PodGroupManager struct {
7979
pgLister pglister.PodGroupLister
8080
// podLister is pod lister
8181
podLister listerv1.PodLister
82-
// reserveResourcePercentage is the reserved resource for the max finished group, range (0,100]
83-
reserveResourcePercentage int32
8482
sync.RWMutex
8583
}
8684

pkg/coscheduling/coscheduling.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323

2424
v1 "k8s.io/api/core/v1"
2525
"k8s.io/apimachinery/pkg/runtime"
26-
"k8s.io/apimachinery/pkg/types"
2726
"k8s.io/client-go/tools/cache"
2827
corev1helpers "k8s.io/component-helpers/scheduling/corev1"
2928
"k8s.io/klog/v2"
@@ -238,12 +237,3 @@ func (cs *Coscheduling) PostBind(ctx context.Context, _ *framework.CycleState, p
238237
klog.V(5).InfoS("PostBind", "pod", klog.KObj(pod))
239238
cs.pgMgr.PostBind(ctx, pod, nodeName)
240239
}
241-
242-
// rejectPod rejects pod in cache
243-
func (cs *Coscheduling) rejectPod(uid types.UID) {
244-
waitingPod := cs.frameworkHandler.GetWaitingPod(uid)
245-
if waitingPod == nil {
246-
return
247-
}
248-
waitingPod.Reject(Name, "")
249-
}

pkg/networkaware/networkoverhead/networkoverhead_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"k8s.io/client-go/informers"
3232
testClientSet "k8s.io/client-go/kubernetes/fake"
3333
"k8s.io/client-go/util/workqueue"
34-
"k8s.io/klog/v2"
3534
"k8s.io/kubernetes/pkg/scheduler/framework"
3635
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
3736
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
@@ -1611,14 +1610,3 @@ func makePodAllocated(selector string, podName string, hostname string, priority
16111610
},
16121611
}
16131612
}
1614-
1615-
// podScheduled returns true if a node is assigned to the given pod.
1616-
func podScheduled(c *testClientSet.Clientset, podNamespace, podName string) bool {
1617-
pod, err := c.CoreV1().Pods(podNamespace).Get(context.TODO(), podName, metav1.GetOptions{})
1618-
if err != nil {
1619-
// This could be a connection error so we want to retry.
1620-
klog.ErrorS(err, "Failed to get pod", "pod", klog.KRef(podNamespace, podName))
1621-
return false
1622-
}
1623-
return pod.Spec.NodeName != ""
1624-
}

pkg/trimaran/loadvariationriskbalancing/analysis_test.go

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,8 @@ import (
2020
"math"
2121
"testing"
2222

23-
"github.com/paypal/load-watcher/pkg/watcher"
2423
"github.com/stretchr/testify/assert"
2524
"sigs.k8s.io/scheduler-plugins/pkg/trimaran"
26-
27-
v1 "k8s.io/api/core/v1"
28-
st "k8s.io/kubernetes/pkg/scheduler/testing"
29-
)
30-
31-
var (
32-
metrics = []watcher.Metric{
33-
{
34-
Name: "no_name",
35-
Type: watcher.CPU,
36-
Operator: "",
37-
Value: 40,
38-
},
39-
{
40-
Name: "cpu_running_avg",
41-
Type: watcher.CPU,
42-
Operator: watcher.Average,
43-
Value: 40,
44-
},
45-
{
46-
Name: "cpu_running_std",
47-
Type: watcher.CPU,
48-
Operator: watcher.Std,
49-
Value: 36,
50-
},
51-
{
52-
Name: "mem_running_avg",
53-
Type: watcher.Memory,
54-
Operator: watcher.Average,
55-
Value: 20,
56-
},
57-
{
58-
Name: "mem_running_std",
59-
Type: watcher.Memory,
60-
Operator: watcher.Std,
61-
Value: 10,
62-
},
63-
}
64-
65-
nodeResources = map[v1.ResourceName]string{
66-
v1.ResourceCPU: "1000m",
67-
v1.ResourceMemory: "1Gi",
68-
}
69-
70-
node0 = st.MakeNode().Name("node0").Capacity(nodeResources).Obj()
7125
)
7226

7327
func TestComputeScore(t *testing.T) {

pkg/util/podgroup_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ import (
2222
"k8s.io/kubernetes/pkg/apis/core"
2323
)
2424

25-
type test struct {
26-
old interface{}
27-
new interface{}
28-
expectedError bool
29-
}
30-
3125
func TestCreateMergePatch(t *testing.T) {
3226
tests := []struct {
3327
old interface{}

0 commit comments

Comments
 (0)