Merge pull request #134967 from ttsuuubasa/dra-bc-allocator-test

scheduler: KEP-5007 allocator test - devices w/wo BindingConditions
This commit is contained in:
Kubernetes Prow Robot 2025-11-04 07:14:17 -08:00 committed by GitHub
commit ac46677d2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3960,6 +3960,32 @@ func TestAllocator(t *testing.T,
},
},
},
"binding-conditions-with-and-without": {
features: Features{
DeviceBindingAndStatus: true,
},
claimsToAllocate: objects(
claimWithRequests(claim0, nil,
request(req0, classA, 1),
request(req1, classA, 1))),
classes: objects(class(classA, driverA)),
slices: unwrap(slice(slice1, node1, pool1, driverA,
device(device1, nil, nil),
device(device2, nil, nil).withBindingConditions([]string{"IsPrepare"}, []string{"BindingFailed"}),
)),
node: node(node1, region1),
expectResults: []any{
resourceapi.AllocationResult{
Devices: resourceapi.DeviceAllocationResult{
Results: []resourceapi.DeviceRequestAllocationResult{
deviceAllocationResult(req0, driverA, pool1, device1, false),
deviceRequestAllocationResultWithBindingConditions(req1, driverA, pool1, device2, []string{"IsPrepare"}, []string{"BindingFailed"}),
},
},
NodeSelector: localNodeSelector(node1),
},
},
},
"binding-conditions-without-feature-gate": {
features: Features{
DeviceBindingAndStatus: false,