mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 00:08:11 +00:00
Log registry refresh errors in cdi list
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
4c513d536b
commit
feb069a2e9
@ -72,13 +72,12 @@ func (m command) run(c *cli.Context, cfg *config) error {
|
|||||||
return fmt.Errorf("failed to create CDI cache: %v", err)
|
return fmt.Errorf("failed to create CDI cache: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshErr := registry.Refresh()
|
||||||
devices := registry.ListDevices()
|
devices := registry.ListDevices()
|
||||||
if len(devices) == 0 {
|
|
||||||
m.logger.Info("No CDI devices found")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
m.logger.Infof("Found %d CDI devices", len(devices))
|
m.logger.Infof("Found %d CDI devices", len(devices))
|
||||||
|
if refreshErr != nil {
|
||||||
|
m.logger.Warningf("Refreshing the CDI registry returned the following error(s): %v", refreshErr)
|
||||||
|
}
|
||||||
for _, device := range devices {
|
for _, device := range devices {
|
||||||
fmt.Printf("%s\n", device)
|
fmt.Printf("%s\n", device)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user