@@ -166,7 +166,7 @@ func (sas *SandboxAPIServer) AllocatePodDevices(ctx context.Context, pr *cdireso
166166 // check if this pod already has some devices assigned
167167 podDevices , exists := sas .podDeviceIDMap [pr .PodID ]
168168 if exists && len (podDevices ) == int (pr .Count ) {
169- response .PhysicalDeviceID = podDevices
169+ response .PhysicalDeviceIDs = podDevices
170170 log .Printf ("[Info] Pod (already exists) Allocate Response: %v" , response )
171171 return response , nil
172172 }
@@ -197,7 +197,7 @@ func (sas *SandboxAPIServer) AllocatePodDevices(ctx context.Context, pr *cdireso
197197 // in fact put the iommu_fd/iommu_id instead of the dev itself
198198 physicalDevices = append (physicalDevices , dev )
199199 }
200- response .PhysicalDeviceID = physicalDevices
200+ response .PhysicalDeviceIDs = physicalDevices
201201
202202 log .Printf ("[Info] Pod Allocate Response: %v" , response )
203203 return response , nil
@@ -221,7 +221,7 @@ func (sas *SandboxAPIServer) AllocateContainerDevices(ctx context.Context, cr *c
221221
222222 // now we get the physical devices associated with PodID
223223 physicalDevices := sas .podDeviceIDMap [cr .PodID ]
224- for _ , vid := range cr .VirtualDeviceID {
224+ for _ , vid := range cr .VirtualDeviceIDs {
225225 if _ , ok := sas .virtualDeviceIDMap [vid ]; ok {
226226 err := fmt .Errorf ("Virtual Device ID %s is already taken" , vid )
227227 log .Print (err )
@@ -248,7 +248,8 @@ func (sas *SandboxAPIServer) AllocateContainerDevices(ctx context.Context, cr *c
248248 sas .containerDeviceIDMap [cr .ContainerID ] = containerDevices
249249 sas .virtualDeviceIDMap [vid ] = physDev
250250 sas .deviceVirtualIDMap [physDev ] = vid
251- response .PhysicalDeviceID = append (response .PhysicalDeviceID , devicePath )
251+ response .VirtualDeviceIDs = append (response .VirtualDeviceIDs , vid )
252+ response .PhysicalDeviceIDs = append (response .PhysicalDeviceIDs , devicePath )
252253 assigned = true
253254 break
254255 }
@@ -272,7 +273,7 @@ func (sas *SandboxAPIServer) FreeContainerDevices(ctx context.Context, cr *cdire
272273 physDev := sas .virtualDeviceIDMap [vid ]
273274 delete (sas .virtualDeviceIDMap , vid )
274275 delete (sas .deviceVirtualIDMap , physDev )
275- response .PhysicalDeviceID = append (response .PhysicalDeviceID , physDev )
276+ response .PhysicalDeviceIDs = append (response .PhysicalDeviceIDs , physDev )
276277 }
277278 delete (sas .containerDeviceIDMap , cr .ContainerID )
278279
@@ -294,12 +295,12 @@ func (sas *SandboxAPIServer) FreePodDevices(ctx context.Context, pr *cdiresolver
294295 log .Printf ("[INFO] Free Pod Devices request: %v" , pr )
295296 // remove all physical devices associated with pod
296297 response := & cdiresolver.PhysicalDeviceResponse {}
297- response .PhysicalDeviceID = sas .podDeviceIDMap [pr .PodID ]
298+ response .PhysicalDeviceIDs = sas .podDeviceIDMap [pr .PodID ]
298299 delete (sas .podDeviceIDMap , pr .PodID )
299300
300301 // put the devices back into available device list for the given type
301302 deviceType := pr .DeviceType
302- sas .deviceIDs [deviceType ] = append (sas .deviceIDs [deviceType ], response .PhysicalDeviceID ... )
303+ sas .deviceIDs [deviceType ] = append (sas .deviceIDs [deviceType ], response .PhysicalDeviceIDs ... )
303304
304305 // also double check and free the virtual device IDs associated with these physical devices
305306 // get containers for the pod:
@@ -317,7 +318,7 @@ func (sas *SandboxAPIServer) FreePodDevices(ctx context.Context, pr *cdiresolver
317318 // in case there is some physical device assigned to the pod
318319 // and mapped to a virtual device, but never had a container associated with it
319320 // we still need to clean it up
320- for _ , pdev := range response .PhysicalDeviceID {
321+ for _ , pdev := range response .PhysicalDeviceIDs {
321322 delete (sas .deviceVirtualIDMap , pdev )
322323 }
323324
0 commit comments