mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
podresources: test: add test for nil Topology
From https://github.com/kubernetes/kubernetes/pull/96553 we are reminded we need to handle the case on which a device plugin reports nil Topology, which is legal. Add unit test to ensure this case is handled. Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
parent
da55ef0b9a
commit
e930799d28
@ -177,6 +177,10 @@ func TestAllocatableResources(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ResourceName: "resource-nt",
|
||||||
|
DeviceIds: []string{"devA"},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
allCPUs := []int64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}
|
allCPUs := []int64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}
|
||||||
@ -230,6 +234,10 @@ func TestAllocatableResources(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ResourceName: "resource-nt",
|
||||||
|
DeviceIds: []string{"devA"},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -261,6 +269,10 @@ func TestAllocatableResources(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ResourceName: "resource-nt",
|
||||||
|
DeviceIds: []string{"devA"},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user