Merge pull request #101297 from houjun41544/20210421-volumezone

Remove redundant checks
This commit is contained in:
Kubernetes Prow Robot 2021-04-21 19:15:56 -07:00 committed by GitHub
commit a160d1dedc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,10 +116,6 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod *
return framework.AsStatus(err)
}
if pvc == nil {
return framework.NewStatus(framework.Error, fmt.Sprintf("PersistentVolumeClaim was not found: %q", pvcName))
}
pvName := pvc.Spec.VolumeName
if pvName == "" {
scName := storagehelpers.GetPersistentVolumeClaimClass(pvc)
@ -148,10 +144,6 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod *
return framework.AsStatus(err)
}
if pv == nil {
return framework.NewStatus(framework.Error, fmt.Sprintf("PersistentVolume was not found: %q", pvName))
}
for k, v := range pv.ObjectMeta.Labels {
if !volumeZoneLabels.Has(k) {
continue