diff --git a/pkg/rescheduler/resheduler.go b/pkg/rescheduler/resheduler.go index 4f03ea236..8668b249c 100644 --- a/pkg/rescheduler/resheduler.go +++ b/pkg/rescheduler/resheduler.go @@ -67,7 +67,7 @@ func Run(rs *options.ReschedulerServer) error { if reschedulerPolicy != nil { fmt.Printf("\nreschedulerPolicy: %#v\n", reschedulerPolicy) } else { - fmt.Printf("\nreschedulerPolicy is nil\n") + return fmt.Errorf("\nreschedulerPolicy is nil\n") } evictionPolicyGroupVersion, err := eutils.SupportEviction(rs.Client) @@ -82,7 +82,7 @@ func Run(rs *options.ReschedulerServer) error { } strategies.RemoveDuplicatePods(rs.Client, evictionPolicyGroupVersion, nodes) - strategies.LowNodeUtilization(rs.Client, evictionPolicyGroupVersion, nodes) + strategies.LowNodeUtilization(rs.Client, reschedulerPolicy.Strategies["LowNodeUtilization"], evictionPolicyGroupVersion, nodes) return nil } diff --git a/pkg/rescheduler/strategies/lownodeutilization.go b/pkg/rescheduler/strategies/lownodeutilization.go index be0ed0a82..088cf3a00 100644 --- a/pkg/rescheduler/strategies/lownodeutilization.go +++ b/pkg/rescheduler/strategies/lownodeutilization.go @@ -31,7 +31,7 @@ import ( type NodeUsageMap map[*v1.Node]api.ResourceThresholds -func LowNodeUtilization(client clientset.Interface, policyGroupVersion string, nodes []*v1.Node) { +func LowNodeUtilization(client clientset.Interface, strategy api.ReschedulerStrategy, evictionPolicyGroupVersion string, nodes []*v1.Node) { nodeUsageMap := NodeUsageMap{} for _, node := range nodes { nodeUsageMap[node] = NodeUtilization(client, node)