@@ -289,6 +289,9 @@ func (plugin *USBDevicePlugin) ListAndWatch(_ *pluginapi.Empty, lws pluginapi.De
289
289
response := pluginapi.ListAndWatchResponse {
290
290
Devices : devices ,
291
291
}
292
+ fmt .Println ("===================" )
293
+ fmt .Printf ("devices: %#v\n " , devices )
294
+ fmt .Println ("===================" )
292
295
err := lws .Send (& response )
293
296
if err != nil {
294
297
plugin .logger .Reason (err ).Warningf ("Failed to send device plugin %s" ,
@@ -327,6 +330,9 @@ func (plugin *USBDevicePlugin) ListAndWatch(_ *pluginapi.Empty, lws pluginapi.De
327
330
328
331
// Interface to allocate requested USBDevice, exported by ListAndWatch
329
332
func (plugin * USBDevicePlugin ) Allocate (_ context.Context , allocRequest * pluginapi.AllocateRequest ) (* pluginapi.AllocateResponse , error ) {
333
+ fmt .Println ("===================" )
334
+ fmt .Printf ("request: %#v\n " , allocRequest )
335
+ fmt .Println ("===================" )
330
336
allocResponse := new (pluginapi.AllocateResponse )
331
337
env := make (map [string ]string )
332
338
for _ , request := range allocRequest .ContainerRequests {
@@ -395,7 +401,7 @@ func NewUSBDevicePlugin(usb v1beta1.USBDevice) (*USBDevicePlugin, error) {
395
401
socketPath : SocketPath (resourceID ),
396
402
resourceName : usb .Status .ResourceName ,
397
403
device : & PluginDevice {
398
- ID : usb .Name ,
404
+ ID : usb .Status . ResourceName ,
399
405
DevicePath : usb .Status .DevicePath ,
400
406
Bus : bus ,
401
407
DeviceNumber : deviceNumber ,
0 commit comments