From feb069a2e9b1dedb816d60837665a51f84641e46 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 8 Aug 2023 15:53:43 +0200 Subject: [PATCH] Log registry refresh errors in cdi list Signed-off-by: Evan Lezar --- cmd/nvidia-ctk/cdi/list/list.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/nvidia-ctk/cdi/list/list.go b/cmd/nvidia-ctk/cdi/list/list.go index 2acec2e4..68530ab8 100644 --- a/cmd/nvidia-ctk/cdi/list/list.go +++ b/cmd/nvidia-ctk/cdi/list/list.go @@ -72,13 +72,12 @@ func (m command) run(c *cli.Context, cfg *config) error { return fmt.Errorf("failed to create CDI cache: %v", err) } + refreshErr := registry.Refresh() 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)) + if refreshErr != nil { + m.logger.Warningf("Refreshing the CDI registry returned the following error(s): %v", refreshErr) + } for _, device := range devices { fmt.Printf("%s\n", device) }