From 6e9112b7fe0b2d1208b7a307c653d640e99f1a4f Mon Sep 17 00:00:00 2001 From: Fabio Bertinatto Date: Wed, 31 Jul 2019 12:56:11 +0200 Subject: [PATCH] When PVC is invalid, don't count volumes in scheduler predicate --- pkg/scheduler/algorithm/predicates/predicates.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/scheduler/algorithm/predicates/predicates.go b/pkg/scheduler/algorithm/predicates/predicates.go index e74e006d11a..fa67c98f50e 100644 --- a/pkg/scheduler/algorithm/predicates/predicates.go +++ b/pkg/scheduler/algorithm/predicates/predicates.go @@ -422,9 +422,9 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []v1.Volume, namespace s pvc, err := c.pvcInfo.GetPersistentVolumeClaimInfo(namespace, pvcName) if err != nil || pvc == nil { - // if the PVC is not found, log the error and count the PV towards the PV limit - klog.V(4).Infof("Unable to look up PVC info for %s/%s, assuming PVC matches predicate when counting limits: %v", namespace, pvcName, err) - filteredVolumes[pvID] = true + // If the PVC is invalid, we don't count the volume because + // there's no guarantee that it belongs to the running predicate. + klog.V(4).Infof("Unable to look up PVC info for %s/%s, assuming PVC doesn't match predicate when counting limits: %v", namespace, pvcName, err) continue }