@@ -44,6 +44,10 @@ func TestToPodPodStatusFailed(t *testing.T) {
4444 Status : string (v1 .PodFailed ),
4545 Warnings : []common.Event {},
4646 ContainerStatuses : make ([]ContainerStatus , 0 ),
47+ AllocatedResources : PodAllocatedResources {
48+ GPURequests : []GPUAllocation {},
49+ GPULimits : []GPUAllocation {},
50+ },
4751 }
4852
4953 actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -72,6 +76,10 @@ func TestToPodPodStatusSucceeded(t *testing.T) {
7276 Status : string (v1 .PodSucceeded ),
7377 Warnings : []common.Event {},
7478 ContainerStatuses : make ([]ContainerStatus , 0 ),
79+ AllocatedResources : PodAllocatedResources {
80+ GPURequests : []GPUAllocation {},
81+ GPULimits : []GPUAllocation {},
82+ },
7583 }
7684
7785 actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -104,6 +112,10 @@ func TestToPodPodStatusRunning(t *testing.T) {
104112 Status : string (v1 .PodRunning ),
105113 Warnings : []common.Event {},
106114 ContainerStatuses : make ([]ContainerStatus , 0 ),
115+ AllocatedResources : PodAllocatedResources {
116+ GPURequests : []GPUAllocation {},
117+ GPULimits : []GPUAllocation {},
118+ },
107119 }
108120
109121 actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -132,6 +144,10 @@ func TestToPodPodStatusPending(t *testing.T) {
132144 Status : string (v1 .PodPending ),
133145 Warnings : []common.Event {},
134146 ContainerStatuses : make ([]ContainerStatus , 0 ),
147+ AllocatedResources : PodAllocatedResources {
148+ GPURequests : []GPUAllocation {},
149+ GPULimits : []GPUAllocation {},
150+ },
135151 }
136152
137153 actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -177,6 +193,10 @@ func TestToPodContainerStates(t *testing.T) {
177193 State : Waiting ,
178194 },
179195 },
196+ AllocatedResources : PodAllocatedResources {
197+ GPURequests : []GPUAllocation {},
198+ GPULimits : []GPUAllocation {},
199+ },
180200 }
181201
182202 actual := toPod (pod , & MetricsByPod {}, []common.Event {})
@@ -199,6 +219,10 @@ func TestToPod(t *testing.T) {
199219 TypeMeta : types.TypeMeta {Kind : types .ResourceKindPod },
200220 Warnings : []common.Event {},
201221 ContainerStatuses : make ([]ContainerStatus , 0 ),
222+ AllocatedResources : PodAllocatedResources {
223+ GPURequests : []GPUAllocation {},
224+ GPULimits : []GPUAllocation {},
225+ },
202226 },
203227 }, {
204228 pod : & v1.Pod {
@@ -214,6 +238,10 @@ func TestToPod(t *testing.T) {
214238 },
215239 Warnings : []common.Event {},
216240 ContainerStatuses : make ([]ContainerStatus , 0 ),
241+ AllocatedResources : PodAllocatedResources {
242+ GPURequests : []GPUAllocation {},
243+ GPULimits : []GPUAllocation {},
244+ },
217245 },
218246 },
219247 }
0 commit comments