mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-04-24 15:48:51 -04:00
declare in front
This commit is contained in:
parent
83e46f0a9e
commit
9727cd0636
1 changed files with 2 additions and 2 deletions
|
|
@ -308,7 +308,8 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []v1.Volume, namespace s
|
|||
continue
|
||||
}
|
||||
|
||||
if pvc.Spec.VolumeName == "" {
|
||||
pvName := pvc.Spec.VolumeName
|
||||
if pvName == "" {
|
||||
// PVC is not bound. It was either deleted and created again or
|
||||
// it was forcefuly unbound by admin. The pod can still use the
|
||||
// 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
|
|||
continue
|
||||
}
|
||||
|
||||
pvName := pvc.Spec.VolumeName
|
||||
pv, err := c.pvInfo.GetPersistentVolumeInfo(pvName)
|
||||
if err != nil || pv == nil {
|
||||
// if the PV is not found, log the error
|
||||
|
|
|
|||
Loading…
Reference in a new issue