mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
scheduler: KEP-5007 allocator test - devices w/wo BindingConditions
Verify allocation behavior when a ResourceSlice contains both devices with and without BindingConditions: ensure the both devices are successfully allocated via two requests in a single ResourceClaim. Signed-off-by: Tsubasa Watanabe <w.tsubasa@fujitsu.com>
This commit is contained in:
parent
150b4dc15e
commit
79df44ca52
1 changed files with 26 additions and 0 deletions
|
|
@ -3919,6 +3919,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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue