@@ -53,7 +53,7 @@ func (pl *TaintToleration) Name() string {
53
53
// Filter invoked at the filter extension point.
54
54
func (pl * TaintToleration ) Filter (ctx context.Context , state * framework.CycleState , pod * v1.Pod , nodeInfo * framework.NodeInfo ) * framework.Status {
55
55
if nodeInfo == nil || nodeInfo .Node () == nil {
56
- return framework .NewStatus ( framework . Error , "invalid nodeInfo" )
56
+ return framework .AsStatus ( fmt . Errorf ( "invalid nodeInfo" ) )
57
57
}
58
58
59
59
filterPredicate := func (t * v1.Taint ) bool {
@@ -138,13 +138,13 @@ func countIntolerableTaintsPreferNoSchedule(taints []v1.Taint, tolerations []v1.
138
138
func (pl * TaintToleration ) Score (ctx context.Context , state * framework.CycleState , pod * v1.Pod , nodeName string ) (int64 , * framework.Status ) {
139
139
nodeInfo , err := pl .handle .SnapshotSharedLister ().NodeInfos ().Get (nodeName )
140
140
if err != nil || nodeInfo .Node () == nil {
141
- return 0 , framework .NewStatus ( framework . Error , fmt .Sprintf ("getting node %q from Snapshot: %v " , nodeName , err ))
141
+ return 0 , framework .AsStatus ( fmt .Errorf ("getting node %q from Snapshot: %w " , nodeName , err ))
142
142
}
143
143
node := nodeInfo .Node ()
144
144
145
145
s , err := getPreScoreState (state )
146
146
if err != nil {
147
- return 0 , framework .NewStatus ( framework . Error , err . Error () )
147
+ return 0 , framework .AsStatus ( err )
148
148
}
149
149
150
150
score := int64 (countIntolerableTaintsPreferNoSchedule (node .Spec .Taints , s .tolerationsPreferNoSchedule ))
0 commit comments