Merge pull request #95066 from SataQiu/wrap-errors-2020092502

Wrap errors for NodeLabel, NodePorts, NodePreferAvoidPods and NodeResourcesBalancedAllocation plugins
This commit is contained in:
Kubernetes Prow Robot
2020-10-13 09:46:27 -07:00
committed by GitHub
5 changed files with 8 additions and 7 deletions

View File

@@ -49,7 +49,7 @@ func (ba *BalancedAllocation) Name() string {
func (ba *BalancedAllocation) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {
nodeInfo, err := ba.handle.SnapshotSharedLister().NodeInfos().Get(nodeName)
if err != nil {
return 0, framework.NewStatus(framework.Error, fmt.Sprintf("getting node %q from Snapshot: %v", nodeName, err))
return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err))
}
// ba.score favors nodes with balanced resource usage rate.