Unverified Commit 588c1e97 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #56271 from tanshanshan/fix-little-scheduler

Automatic merge from submit-queue (batch tested with PRs 57211, 56150, 56368, 56271, 55957). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Put variable declared in the front. **What this PR does / why we need it**: put variable declared in the front. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note ```
parents 7bbb84ca 9727cd06
...@@ -308,7 +308,8 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []v1.Volume, namespace s ...@@ -308,7 +308,8 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []v1.Volume, namespace s
continue continue
} }
if pvc.Spec.VolumeName == "" { pvName := pvc.Spec.VolumeName
if pvName == "" {
// PVC is not bound. It was either deleted and created again or // PVC is not bound. It was either deleted and created again or
// it was forcefuly unbound by admin. The pod can still use the // it was forcefuly unbound by admin. The pod can still use the
// original PV where it was bound to -> log the error and count // original PV where it was bound to -> log the error and count
...@@ -318,7 +319,6 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []v1.Volume, namespace s ...@@ -318,7 +319,6 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []v1.Volume, namespace s
continue continue
} }
pvName := pvc.Spec.VolumeName
pv, err := c.pvInfo.GetPersistentVolumeInfo(pvName) pv, err := c.pvInfo.GetPersistentVolumeInfo(pvName)
if err != nil || pv == nil { if err != nil || pv == nil {
// if the PV is not found, log the error // if the PV is not found, log the error
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment