cleanup useless null pointer check about nodeInfo.Node() from snapshot for in-tree plugins

This commit is contained in:
dingzhu lurong
2023-05-06 10:59:23 +08:00
parent 8f3f997a98
commit ed26fcf5b8
14 changed files with 177 additions and 51 deletions

View File

@@ -149,9 +149,7 @@ func (pl *NodeAffinity) PreFilterExtensions() framework.PreFilterExtensions {
// the plugin's added affinity.
func (pl *NodeAffinity) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
node := nodeInfo.Node()
if node == nil {
return framework.NewStatus(framework.Error, "node not found")
}
if pl.addedNodeSelector != nil && !pl.addedNodeSelector.Match(node) {
return framework.NewStatus(framework.UnschedulableAndUnresolvable, errReasonEnforced)
}