Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for SelectCandidate (0.24 sec)

  1. pkg/scheduler/framework/preemption/preemption.go

    			victims: victimsMap[nodeName],
    			name:    nodeName,
    		})
    	}
    	return newCandidates, nil
    }
    
    // SelectCandidate chooses the best-fit candidate from given <candidates> and return it.
    // NOTE: This method is exported for easier testing in default preemption.
    func (ev *Evaluator) SelectCandidate(ctx context.Context, candidates []Candidate) Candidate {
    	logger := klog.FromContext(ctx)
    
    	if len(candidates) == 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 15:52:16 UTC 2024
    - 25.1K bytes
    - Viewed (0)
  2. pkg/scheduler/framework/preemption/preemption_test.go

    					Interface:  fakePreemptionScorePostFilterPlugin,
    					State:      state,
    				}
    				candidates, _, _ := pe.DryRunPreemption(context.Background(), pod, nodeInfos, nil, 0, int32(len(nodeInfos)))
    				s := pe.SelectCandidate(ctx, candidates)
    				if s == nil || len(s.Name()) == 0 {
    					t.Errorf("expect any node in %v, but no candidate selected", tt.expected)
    					return
    				}
    				if diff := cmp.Diff(tt.expected, s.Name()); diff != "" {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 15:52:16 UTC 2024
    - 18.7K bytes
    - Viewed (0)
  3. pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go

    				Interface:  pl,
    			}
    			offset, numCandidates := pl.GetOffsetAndNumCandidates(int32(len(nodeInfos)))
    			candidates, _, _ := pe.DryRunPreemption(ctx, tt.pod, nodeInfos, nil, offset, numCandidates)
    			s := pe.SelectCandidate(ctx, candidates)
    			if s == nil || len(s.Name()) == 0 {
    				return
    			}
    			found := false
    			for _, nodeName := range tt.expected {
    				if nodeName == s.Name() {
    					found = true
    					break
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 15:52:16 UTC 2024
    - 82.8K bytes
    - Viewed (0)
Back to top