Commit a405df43 authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

Merge pull request #25710 from xiangpengzhao/fix_predicate

Automatic merge from submit-queue No need to log empty string in predicates.go If `pvcName` is empty, we don't need to log it.
parents c4aa7ee0 74901ae1
...@@ -156,7 +156,7 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []api.Volume, namespace ...@@ -156,7 +156,7 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []api.Volume, namespace
} else if vol.PersistentVolumeClaim != nil { } else if vol.PersistentVolumeClaim != nil {
pvcName := vol.PersistentVolumeClaim.ClaimName pvcName := vol.PersistentVolumeClaim.ClaimName
if pvcName == "" { if pvcName == "" {
return fmt.Errorf("PersistentVolumeClaim had no name: %q", pvcName) return fmt.Errorf("PersistentVolumeClaim had no name")
} }
pvc, err := c.pvcInfo.GetPersistentVolumeClaimInfo(namespace, pvcName) pvc, err := c.pvcInfo.GetPersistentVolumeClaimInfo(namespace, pvcName)
if err != nil { if err != nil {
...@@ -322,7 +322,7 @@ func (c *VolumeZoneChecker) predicate(pod *api.Pod, nodeInfo *schedulercache.Nod ...@@ -322,7 +322,7 @@ func (c *VolumeZoneChecker) predicate(pod *api.Pod, nodeInfo *schedulercache.Nod
if volume.PersistentVolumeClaim != nil { if volume.PersistentVolumeClaim != nil {
pvcName := volume.PersistentVolumeClaim.ClaimName pvcName := volume.PersistentVolumeClaim.ClaimName
if pvcName == "" { if pvcName == "" {
return false, fmt.Errorf("PersistentVolumeClaim had no name: %q", pvcName) return false, fmt.Errorf("PersistentVolumeClaim had no name")
} }
pvc, err := c.pvcInfo.GetPersistentVolumeClaimInfo(namespace, pvcName) pvc, err := c.pvcInfo.GetPersistentVolumeClaimInfo(namespace, pvcName)
if err != nil { if err != nil {
......
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