mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
When PVC is invalid, don't count volumes in scheduler predicate
This commit is contained in:
parent
ee7b48b7c5
commit
6e9112b7fe
@ -422,9 +422,9 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []v1.Volume, namespace s
|
|||||||
|
|
||||||
pvc, err := c.pvcInfo.GetPersistentVolumeClaimInfo(namespace, pvcName)
|
pvc, err := c.pvcInfo.GetPersistentVolumeClaimInfo(namespace, pvcName)
|
||||||
if err != nil || pvc == nil {
|
if err != nil || pvc == nil {
|
||||||
// if the PVC is not found, log the error and count the PV towards the PV limit
|
// If the PVC is invalid, we don't count the volume because
|
||||||
klog.V(4).Infof("Unable to look up PVC info for %s/%s, assuming PVC matches predicate when counting limits: %v", namespace, pvcName, err)
|
// there's no guarantee that it belongs to the running predicate.
|
||||||
filteredVolumes[pvID] = true
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user