@@ -728,7 +728,7 @@ func TestPodContainerDeviceAllocation(t *testing.T) {
728
728
pod := testCase .testPod
729
729
activePods = append (activePods , pod )
730
730
podsStub .updateActivePods (activePods )
731
- err := testManager .Allocate (pod )
731
+ err := testManager .Allocate (pod , & pod . Spec . Containers [ 0 ] )
732
732
if ! reflect .DeepEqual (err , testCase .expErr ) {
733
733
t .Errorf ("DevicePluginManager error (%v). expected error: %v but got: %v" ,
734
734
testCase .description , testCase .expErr , err )
@@ -823,7 +823,12 @@ func TestInitContainerDeviceAllocation(t *testing.T) {
823
823
},
824
824
}
825
825
podsStub .updateActivePods ([]* v1.Pod {podWithPluginResourcesInInitContainers })
826
- err = testManager .Allocate (podWithPluginResourcesInInitContainers )
826
+ for _ , container := range podWithPluginResourcesInInitContainers .Spec .InitContainers {
827
+ err = testManager .Allocate (podWithPluginResourcesInInitContainers , & container )
828
+ }
829
+ for _ , container := range podWithPluginResourcesInInitContainers .Spec .Containers {
830
+ err = testManager .Allocate (podWithPluginResourcesInInitContainers , & container )
831
+ }
827
832
as .Nil (err )
828
833
podUID := string (podWithPluginResourcesInInitContainers .UID )
829
834
initCont1 := podWithPluginResourcesInInitContainers .Spec .InitContainers [0 ].Name
@@ -929,7 +934,7 @@ func TestDevicePreStartContainer(t *testing.T) {
929
934
activePods := []* v1.Pod {}
930
935
activePods = append (activePods , pod )
931
936
podsStub .updateActivePods (activePods )
932
- err = testManager .Allocate (pod )
937
+ err = testManager .Allocate (pod , & pod . Spec . Containers [ 0 ] )
933
938
as .Nil (err )
934
939
runContainerOpts , err := testManager .GetDeviceRunContainerOptions (pod , & pod .Spec .Containers [0 ])
935
940
as .Nil (err )
0 commit comments