func GeneralPredicates(pod *v1.Pod, nodeInfo *schedulerframework.NodeInfo) ([]PredicateFailureReason, error) {
	if nodeInfo.Node() == nil {
		return nil, fmt.Errorf("node not found")
	}

	var reasons []PredicateFailureReason
	for _, r := range noderesources.Fits(pod, nodeInfo) {
		reasons = append(reasons, &InsufficientResourceError{
			ResourceName: r.ResourceName,
			Requested:    r.Requested,
			Used:         r.Used,
			Capacity:     r.Capacity,
		})
	}

	if !pluginhelper.PodMatchesNodeSelectorAndAffinityTerms(pod, nodeInfo.Node()) {
		reasons = append(reasons, &PredicateFailureError{nodeaffinity.Name, nodeaffinity.ErrReason})
	}
	if !nodename.Fits(pod, nodeInfo) {
		reasons = append(reasons, &PredicateFailureError{nodename.Name, nodename.ErrReason})
	}
	if !nodeports.Fits(pod, nodeInfo) {
		reasons = append(reasons, &PredicateFailureError{nodeports.Name, nodeports.ErrReason})
	}

	return reasons, nil
}
// GeneralPredicates checks a group of predicates that the kubelet cares about.
GeneralPredicates checks a group of predicates that the kubelet cares about.
// GeneralPredicates checks a group of predicates that the kubelet cares about .
func GeneralPredicates(pod *v1.Pod, nodeInfo *schedulerframework.NodeInfo) ([]PredicateFailureReason, error) {
	if nodeInfo.Node() == nil {
		return nil, fmt.Errorf("node not found")
	}
	var reasons []PredicateFailureReason
	for _, r := range noderesources.Fits(pod, nodeInfo) {
		reasons = append(reasons, &InsufficientResourceError{
			ResourceName: r.ResourceName,
			Requested:    r.Requested,
			Used:         r.Used,
			Capacity:     r.Capacity,
		})
	}
	if !pluginhelper.PodMatchesNodeSelectorAndAffinityTerms(pod, nodeInfo.Node()) {
		reasons = append(reasons, &PredicateFailureError{nodeaffinity.Name, nodeaffinity.ErrReason})
	}
	if !nodename.Fits(pod, nodeInfo) {
		reasons = append(reasons, &PredicateFailureError{nodename.Name, nodename.ErrReason})
	}
	if !nodeports.Fits(pod, nodeInfo) {
		reasons = append(reasons, &PredicateFailureError{nodeports.Name, nodeports.ErrReason})
	}
	return reasons, nil
}
func GeneralPredicates ( pod * v1 . Pod , nodeInfo * schedulerframework . NodeInfo ) ( [ ] PredicateFailureReason , error ) { if nodeInfo . Node ( ) == nil { return nil , fmt . Errorf ( " " ) } var reasons [ ] PredicateFailureReason for _ , r := range noderesources . Fits ( pod , nodeInfo ) { reasons = append ( reasons , & InsufficientResourceError { ResourceName : r . ResourceName , Requested : r . Requested , Used : r . Used , Capacity : r . Capacity , } ) } if ! pluginhelper . PodMatchesNodeSelectorAndAffinityTerms ( pod , nodeInfo . Node ( ) ) { reasons = append ( reasons , & PredicateFailureError { nodeaffinity . Name , nodeaffinity . ErrReason } ) } if ! nodename . Fits ( pod , nodeInfo ) { reasons = append ( reasons , & PredicateFailureError { nodename . Name , nodename . ErrReason } ) } if ! nodeports . Fits ( pod , nodeInfo ) { reasons = append ( reasons , & PredicateFailureError { nodeports . Name , nodeports . ErrReason } ) } return reasons , nil }
GeneralPredicates checks a group of predicates that the kubelet cares about.
GeneralPredicates checks a group of predicates that the kubelet cares about .