Skip to content

Commit 0aaade7

Browse files
committed
test
Signed-off-by: Jack Yu <jack.yu@suse.com>
1 parent 8967558 commit 0aaade7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/deviceplugins/usb_device_plugin.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ func (plugin *USBDevicePlugin) ListAndWatch(_ *pluginapi.Empty, lws pluginapi.De
289289
response := pluginapi.ListAndWatchResponse{
290290
Devices: devices,
291291
}
292+
fmt.Println("===================")
293+
fmt.Printf("devices: %#v\n", devices)
294+
fmt.Println("===================")
292295
err := lws.Send(&response)
293296
if err != nil {
294297
plugin.logger.Reason(err).Warningf("Failed to send device plugin %s",
@@ -327,6 +330,9 @@ func (plugin *USBDevicePlugin) ListAndWatch(_ *pluginapi.Empty, lws pluginapi.De
327330

328331
// Interface to allocate requested USBDevice, exported by ListAndWatch
329332
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("===================")
330336
allocResponse := new(pluginapi.AllocateResponse)
331337
env := make(map[string]string)
332338
for _, request := range allocRequest.ContainerRequests {
@@ -395,7 +401,7 @@ func NewUSBDevicePlugin(usb v1beta1.USBDevice) (*USBDevicePlugin, error) {
395401
socketPath: SocketPath(resourceID),
396402
resourceName: usb.Status.ResourceName,
397403
device: &PluginDevice{
398-
ID: usb.Name,
404+
ID: usb.Status.ResourceName,
399405
DevicePath: usb.Status.DevicePath,
400406
Bus: bus,
401407
DeviceNumber: deviceNumber,

0 commit comments

Comments
 (0)