Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Yu <[email protected]>
  • Loading branch information
Yu-Jack committed Dec 17, 2024
1 parent 8967558 commit 3cb9025
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/deviceplugins/usb_device_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ func (plugin *USBDevicePlugin) ListAndWatch(_ *pluginapi.Empty, lws pluginapi.De
response := pluginapi.ListAndWatchResponse{
Devices: devices,
}
fmt.Println("===================")
for _, device := range devices {
fmt.Printf("devices: %#v\n", *device)
}
fmt.Println("===================")
err := lws.Send(&response)
if err != nil {
plugin.logger.Reason(err).Warningf("Failed to send device plugin %s",
Expand Down Expand Up @@ -327,6 +332,9 @@ func (plugin *USBDevicePlugin) ListAndWatch(_ *pluginapi.Empty, lws pluginapi.De

// Interface to allocate requested USBDevice, exported by ListAndWatch
func (plugin *USBDevicePlugin) Allocate(_ context.Context, allocRequest *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error) {
fmt.Println("===================")
fmt.Printf("request: %#v\n", *allocRequest)
fmt.Println("===================")
allocResponse := new(pluginapi.AllocateResponse)
env := make(map[string]string)
for _, request := range allocRequest.ContainerRequests {
Expand Down Expand Up @@ -395,7 +403,7 @@ func NewUSBDevicePlugin(usb v1beta1.USBDevice) (*USBDevicePlugin, error) {
socketPath: SocketPath(resourceID),
resourceName: usb.Status.ResourceName,
device: &PluginDevice{
ID: usb.Name,
ID: usb.Status.ResourceName,
DevicePath: usb.Status.DevicePath,
Bus: bus,
DeviceNumber: deviceNumber,
Expand Down

0 comments on commit 3cb9025

Please sign in to comment.