Merge pull request #58689 from k82cn/k8s_58648
Automatic merge from submit-queue (batch tested with PRs 58595, 58689). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Checked node.Unscheulable in Toleration predicate. Signed-off-by: Da K. Ma <madaxa@cn.ibm.com> **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #58648 **Release note**: ```release-note None ```
This commit is contained in:
		@@ -1395,6 +1395,14 @@ func (c *PodAffinityChecker) satisfiesPodsAffinityAntiAffinity(pod *v1.Pod, node
 | 
			
		||||
 | 
			
		||||
// PodToleratesNodeTaints checks if a pod tolerations can tolerate the node taints
 | 
			
		||||
func PodToleratesNodeTaints(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error) {
 | 
			
		||||
	if nodeInfo == nil || nodeInfo.Node() == nil {
 | 
			
		||||
		return false, []algorithm.PredicateFailureReason{ErrNodeUnknownCondition}, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if nodeInfo.Node().Spec.Unschedulable {
 | 
			
		||||
		return false, []algorithm.PredicateFailureReason{ErrNodeUnschedulable}, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return podToleratesNodeTaints(pod, nodeInfo, func(t *v1.Taint) bool {
 | 
			
		||||
		// PodToleratesNodeTaints is only interested in NoSchedule and NoExecute taints.
 | 
			
		||||
		return t.Effect == v1.TaintEffectNoSchedule || t.Effect == v1.TaintEffectNoExecute
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user