scheduler's NodeInfo tracks PodInfos instead of Pods

This commit is contained in:
Abdullah Gharaibeh
2020-04-08 15:56:30 -04:00
parent 3072d1e22e
commit b8ddd00312
25 changed files with 358 additions and 381 deletions

View File

@@ -32,10 +32,10 @@ import (
)
// getExistingVolumeCountForNode gets the current number of volumes on node.
func getExistingVolumeCountForNode(pods []*v1.Pod, maxVolumes int) int {
func getExistingVolumeCountForNode(podInfos []*framework.PodInfo, maxVolumes int) int {
volumeCount := 0
for _, pod := range pods {
volumeCount += len(pod.Spec.Volumes)
for _, p := range podInfos {
volumeCount += len(p.Pod.Spec.Volumes)
}
if maxVolumes-volumeCount > 0 {
return maxVolumes - volumeCount