Skip to content

Commit

Permalink
Extends TestPodContainerDeviceAllocation() to expose issue kubernetes…
Browse files Browse the repository at this point in the history
…#53548

that container allocation request may fail if it requests some
extended resource not managed by any device plugin.
  • Loading branch information
jiayingz committed Oct 9, 2017
1 parent 175a6de commit 773dcad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/kubelet/cm/device_plugin_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func TestPodContainerDeviceAllocation(t *testing.T) {
resourceQuantity2 := *resource.NewQuantity(int64(1), resource.DecimalSI)
devId3 := "dev3"
devId4 := "dev4"
nonDevicePluginResource := "domain3.com/resource3"

m, err := NewDevicePluginManagerTestStub()
as := assert.New(t)
Expand Down Expand Up @@ -216,9 +217,10 @@ func TestPodContainerDeviceAllocation(t *testing.T) {
Name: string(uuid.NewUUID()),
Resources: v1.ResourceRequirements{
Limits: v1.ResourceList{
v1.ResourceName(resourceName1): resourceQuantity1,
v1.ResourceName("cpu"): resourceQuantity1,
v1.ResourceName(resourceName2): resourceQuantity2,
v1.ResourceName(resourceName1): resourceQuantity1,
v1.ResourceName("cpu"): resourceQuantity1,
v1.ResourceName(resourceName2): resourceQuantity2,
v1.ResourceName(nonDevicePluginResource): resourceQuantity1,
},
},
},
Expand Down

0 comments on commit 773dcad

Please sign in to comment.