Wrap all errors in pkg/scheduler

This commit is contained in:
Jie Shen
2021-01-28 09:13:40 +08:00
parent b418bc83db
commit f82e3c430c
10 changed files with 15 additions and 15 deletions

View File

@@ -112,7 +112,7 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod *
}
pvc, err := pl.pvcLister.PersistentVolumeClaims(pod.Namespace).Get(pvcName)
if err != nil {
return framework.NewStatus(framework.Error, err.Error())
return framework.AsStatus(err)
}
if pvc == nil {
@@ -144,7 +144,7 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod *
pv, err := pl.pvLister.Get(pvName)
if err != nil {
return framework.NewStatus(framework.Error, err.Error())
return framework.AsStatus(err)
}
if pv == nil {