func (s *Scheduler) nominate(ctx context.Context, workloads []workload.Info, snap cache.Snapshot) []entry {
	log := ctrl.LoggerFrom(ctx)
	entries := make([]entry, 0, len(workloads))
	for _, w := range workloads {
		log := log.WithValues("queuedWorkload", klog.KObj(w.Obj), "clusterQueue", klog.KRef("", w.ClusterQueue))
		cq := snap.ClusterQueues[w.ClusterQueue]
		if cq == nil {
			log.V(3).Info("ClusterQueue not found when calculating workload admission requirements")
			continue
		}
		ns := corev1.Namespace{}
		if err := s.client.Get(ctx, types.NamespacedName{Name: w.Obj.Namespace}, &ns); err != nil {
			log.Error(err, "Looking up namespace")
			continue
		}
		if !cq.NamespaceSelector.Matches(labels.Set(ns.Labels)) {
			log.V(2).Info("Workload namespace doesn't match clusterQueue selector")
			continue
		}
		e := entry{Info: w}
		if !e.assignFlavors(log, cq) {
			log.V(2).Info("Workload didn't fit in remaining clusterQueue even when borrowing")
			continue
		}
		entries = append(entries, e)
	}
	return entries
}
// nominate returns the workloads with their requirements (resource flavors, borrowing) if
// they were admitted by the clusterQueues in the snapshot.
nominate returns the workloads with their requirements (resource flavors, borrowing) if
they were admitted by the clusterQueues in the snapshot.
// nominate returns the workloads with their requirements ( resource flavors borrowing ) if // they were admitted by the clusterQueues in the snapshot .
func (s *Scheduler) nominate(ctx context.Context, workloads []workload.Info, snap cache.Snapshot) []entry {
	log := ctrl.LoggerFrom(ctx)
	entries := make([]entry, 0, len(workloads))
	for _, w := range workloads {
		log := log.WithValues("queuedWorkload", klog.KObj(w.Obj), "clusterQueue", klog.KRef("", w.ClusterQueue))
		cq := snap.ClusterQueues[w.ClusterQueue]
		if cq == nil {
			log.V(3).Info("ClusterQueue not found when calculating workload admission requirements")
			continue
		}
		ns := corev1.Namespace{}
		if err := s.client.Get(ctx, types.NamespacedName{Name: w.Obj.Namespace}, &ns); err != nil {
			log.Error(err, "Looking up namespace")
			continue
		}
		if !cq.NamespaceSelector.Matches(labels.Set(ns.Labels)) {
			log.V(2).Info("Workload namespace doesn't match clusterQueue selector")
			continue
		}
		e := entry{Info: w}
		if !e.assignFlavors(log, cq) {
			log.V(2).Info("Workload didn't fit in remaining clusterQueue even when borrowing")
			continue
		}
		entries = append(entries, e)
	}
	return entries
}
func ( s * Scheduler ) nominate ( ctx context . Context , workloads [ ] workload . Info , snap cache . Snapshot ) [ ] entry { log := ctrl . LoggerFrom ( ctx ) entries := make ( [ ] entry , 0 , len ( workloads ) ) for _ , w := range workloads { log := log . WithValues ( " " , klog . KObj ( w . Obj ) , " " , klog . KRef ( " " , w . ClusterQueue ) ) cq := snap . ClusterQueues [ w . ClusterQueue ] if cq == nil { log . V ( 3 ) . Info ( " " ) continue } ns := corev1 . Namespace { } if err := s . client . Get ( ctx , types . NamespacedName { Name : w . Obj . Namespace } , & ns ) ; err != nil { log . Error ( err , " " ) continue } if ! cq . NamespaceSelector . Matches ( labels . Set ( ns . Labels ) ) { log . V ( 2 ) . Info ( " " ) continue } e := entry { Info : w } if ! e . assignFlavors ( log , cq ) { log . V ( 2 ) . Info ( " " ) continue } entries = append ( entries , e ) } return entries }
nominate returns the workloads with their requirements (resource flavors, borrowing) if
they were admitted by the clusterQueues in the snapshot.
nominate returns the workloads with their requirements ( resource flavors borrowing ) if they were admitted by the clusterQueues in the snapshot .