mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-25 20:59:28 +01:00
refactor(pkg/descheduler): drop unsed clientset parameter from descheduler.runProfiles
This commit is contained in:
@@ -658,7 +658,7 @@ func (d *descheduler) runDeschedulerLoop(ctx context.Context) error {
|
||||
klog.V(3).Infof("Resetting pod evictor counters")
|
||||
d.podEvictor.ResetCounters()
|
||||
|
||||
d.runProfiles(ctx, d.client)
|
||||
d.runProfiles(ctx)
|
||||
|
||||
if d.rs.DryRun {
|
||||
if d.kubeClientSandbox == nil {
|
||||
@@ -680,7 +680,7 @@ func (d *descheduler) runDeschedulerLoop(ctx context.Context) error {
|
||||
// runProfiles runs all the deschedule plugins of all profiles and
|
||||
// later runs through all balance plugins of all profiles. (All Balance plugins should come after all Deschedule plugins)
|
||||
// see https://github.com/kubernetes-sigs/descheduler/issues/979
|
||||
func (d *descheduler) runProfiles(ctx context.Context, client clientset.Interface) {
|
||||
func (d *descheduler) runProfiles(ctx context.Context) {
|
||||
var span trace.Span
|
||||
ctx, span = tracing.Tracer().Start(ctx, "runProfiles")
|
||||
defer span.End()
|
||||
@@ -711,7 +711,7 @@ func (d *descheduler) runProfiles(ctx context.Context, client clientset.Interfac
|
||||
ctx,
|
||||
profile,
|
||||
pluginregistry.PluginRegistry,
|
||||
frameworkprofile.WithClientSet(client),
|
||||
frameworkprofile.WithClientSet(d.client),
|
||||
frameworkprofile.WithSharedInformerFactory(d.sharedInformerFactory),
|
||||
frameworkprofile.WithPodEvictor(d.podEvictor),
|
||||
frameworkprofile.WithGetPodsAssignedToNodeFnc(d.getPodsAssignedToNode),
|
||||
|
||||
@@ -606,7 +606,7 @@ func TestPodEvictorReset(t *testing.T) {
|
||||
func runDeschedulerLoopAndGetEvictedPods(ctx context.Context, t *testing.T, d *descheduler, dryRun bool) []string {
|
||||
d.podEvictor.ResetCounters()
|
||||
|
||||
d.runProfiles(ctx, d.client)
|
||||
d.runProfiles(ctx)
|
||||
|
||||
var evictedPodNames []string
|
||||
if dryRun {
|
||||
@@ -1614,7 +1614,7 @@ func TestEvictedPodRestorationInDryRun(t *testing.T) {
|
||||
// Run descheduling cycle
|
||||
klog.Infof("Running descheduling cycle %d", i)
|
||||
descheduler.podEvictor.ResetCounters()
|
||||
descheduler.runProfiles(ctx, descheduler.client)
|
||||
descheduler.runProfiles(ctx)
|
||||
|
||||
// Verify the pod was evicted (should not exist in fake client anymore)
|
||||
_, err = kubeClientSandbox.fakeClient().CoreV1().Pods(p1.Namespace).Get(ctx, p1.Name, metav1.GetOptions{})
|
||||
|
||||
Reference in New Issue
Block a user