From d3a355d6dc545fde8d1fdfdd8f6643c8b79698b7 Mon Sep 17 00:00:00 2001 From: houjun Date: Wed, 21 Apr 2021 09:55:45 +0800 Subject: [PATCH] Remove redundant checks --- pkg/scheduler/framework/plugins/volumezone/volume_zone.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pkg/scheduler/framework/plugins/volumezone/volume_zone.go b/pkg/scheduler/framework/plugins/volumezone/volume_zone.go index 05fa89d7b82..39c978e29a0 100644 --- a/pkg/scheduler/framework/plugins/volumezone/volume_zone.go +++ b/pkg/scheduler/framework/plugins/volumezone/volume_zone.go @@ -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