1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-27 05:46:13 +01:00

Update actualUsageClient

This commit is contained in:
Jan Chaloupka
2024-11-04 18:11:27 +01:00
parent 80f9c0ada6
commit ad18f41b66
8 changed files with 461 additions and 7 deletions

View File

@@ -74,14 +74,12 @@ func normalizePercentage(percent api.Percentage) api.Percentage {
return percent
}
func getNodeThresholds(
nodes []*v1.Node,
lowThreshold, highThreshold api.ResourceThresholds,
resourceNames []v1.ResourceName,
useDeviationThresholds bool,
usageClient *requestedUsageClient,
usageClient usageClient,
) map[string]NodeThresholds {
nodeThresholdsMap := map[string]NodeThresholds{}
@@ -123,7 +121,7 @@ func getNodeThresholds(
func getNodeUsage(
nodes []*v1.Node,
usageClient *requestedUsageClient,
usageClient usageClient,
) []NodeUsage {
var nodeUsageList []NodeUsage
@@ -432,7 +430,7 @@ func classifyPods(pods []*v1.Pod, filter func(pod *v1.Pod) bool) ([]*v1.Pod, []*
return nonRemovablePods, removablePods
}
func averageNodeBasicresources(nodes []*v1.Node, usageClient *requestedUsageClient) api.ResourceThresholds {
func averageNodeBasicresources(nodes []*v1.Node, usageClient usageClient) api.ResourceThresholds {
total := api.ResourceThresholds{}
average := api.ResourceThresholds{}
numberOfNodes := len(nodes)