mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-27 22:14:52 +01:00
refactor(pkg/descheduler): drop unused fakeEvictedPods variables in the unit tests
This commit is contained in:
@@ -647,11 +647,6 @@ func TestEvictionRequestsCache(t *testing.T) {
|
|||||||
_, descheduler, client := initDescheduler(t, ctxCancel, featureGates, internalDeschedulerPolicy, nil, false, node1, node2, p1, p2, p3, p4)
|
_, descheduler, client := initDescheduler(t, ctxCancel, featureGates, internalDeschedulerPolicy, nil, false, node1, node2, p1, p2, p3, p4)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
var fakeEvictedPods []string
|
|
||||||
descheduler.kubeClientSandbox.podEvictionReactionFnc = func(*fakeclientset.Clientset, *evictedPodsCache) func(action core.Action) (bool, runtime.Object, error) {
|
|
||||||
return podEvictionReactionTestingFnc(&fakeEvictedPods, nil, podEvictionError)
|
|
||||||
}
|
|
||||||
|
|
||||||
var evictedPods []string
|
var evictedPods []string
|
||||||
client.PrependReactor("create", "pods", podEvictionReactionTestingFnc(&evictedPods, func(name string) bool { return name == "p1" || name == "p2" }, nil))
|
client.PrependReactor("create", "pods", podEvictionReactionTestingFnc(&evictedPods, func(name string) bool { return name == "p1" || name == "p2" }, nil))
|
||||||
|
|
||||||
@@ -788,11 +783,6 @@ func TestDeschedulingLimits(t *testing.T) {
|
|||||||
_, descheduler, client := initDescheduler(t, ctxCancel, featureGates, tc.policy, nil, false, node1, node2)
|
_, descheduler, client := initDescheduler(t, ctxCancel, featureGates, tc.policy, nil, false, node1, node2)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
var fakeEvictedPods []string
|
|
||||||
descheduler.kubeClientSandbox.podEvictionReactionFnc = func(*fakeclientset.Clientset, *evictedPodsCache) func(action core.Action) (bool, runtime.Object, error) {
|
|
||||||
return podEvictionReactionTestingFnc(&fakeEvictedPods, nil, podEvictionError)
|
|
||||||
}
|
|
||||||
|
|
||||||
var evictedPods []string
|
var evictedPods []string
|
||||||
client.PrependReactor("create", "pods", podEvictionReactionTestingFnc(&evictedPods, func(name string) bool { return name == "p1" || name == "p2" }, nil))
|
client.PrependReactor("create", "pods", podEvictionReactionTestingFnc(&evictedPods, func(name string) bool { return name == "p1" || name == "p2" }, nil))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user