diff --git a/pkg/descheduler/framework/plugins/loadaware/low_node_load.go b/pkg/descheduler/framework/plugins/loadaware/low_node_load.go index a5190ae89..381ea5457 100644 --- a/pkg/descheduler/framework/plugins/loadaware/low_node_load.go +++ b/pkg/descheduler/framework/plugins/loadaware/low_node_load.go @@ -170,6 +170,17 @@ func (pl *LowNodeLoad) processOneNodePool(ctx context.Context, nodePool *desched logUtilizationCriteria(nodePool.Name, "Criteria for nodes under low thresholds and above high thresholds", lowThresholds, highThresholds, len(lowNodes), len(sourceNodes), len(nodes)) + if len(sourceNodes) == 0 { + klog.V(4).InfoS("All nodes are under target utilization, nothing to do here", "nodePool", nodePool.Name) + return nil + } + + abnormalNodes := filterRealAbnormalNodes(sourceNodes, pl.nodeAnomalyDetectors, nodePool.AnomalyCondition) + if len(abnormalNodes) == 0 { + klog.V(4).InfoS("None of the nodes were detected as anomalous, nothing to do here", "nodePool", nodePool.Name) + return nil + } + if len(lowNodes) == 0 { klog.V(4).InfoS("No nodes are underutilized, nothing to do here, you might tune your thresholds further", "nodePool", nodePool.Name) return nil @@ -188,17 +199,6 @@ func (pl *LowNodeLoad) processOneNodePool(ctx context.Context, nodePool *desched return nil } - if len(sourceNodes) == 0 { - klog.V(4).InfoS("All nodes are under target utilization, nothing to do here", "nodePool", nodePool.Name) - return nil - } - - abnormalNodes := filterRealAbnormalNodes(sourceNodes, pl.nodeAnomalyDetectors, nodePool.AnomalyCondition) - if len(abnormalNodes) == 0 { - klog.V(4).InfoS("None of the nodes were detected as anomalous, nothing to do here", "nodePool", nodePool.Name) - return nil - } - continueEvictionCond := func(nodeInfo NodeInfo, totalAvailableUsages map[corev1.ResourceName]*resource.Quantity) bool { if _, overutilized := isNodeOverutilized(nodeInfo.NodeUsage.usage, nodeInfo.thresholds.highResourceThreshold); !overutilized { resetNodesAsNormal([]NodeInfo{nodeInfo}, pl.nodeAnomalyDetectors)