From 3b8c40c3e69b1b7c8ffefa784ec27929d6cf30db Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 7 Feb 2023 12:04:03 +0100 Subject: [PATCH] Move IPC discoverer to internal/discover package Signed-off-by: Evan Lezar --- cmd/nvidia-ctk/cdi/generate/generate.go | 2 +- {cmd/nvidia-ctk/cdi/generate => internal/discover}/ipc.go | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) rename {cmd/nvidia-ctk/cdi/generate => internal/discover}/ipc.go (89%) diff --git a/cmd/nvidia-ctk/cdi/generate/generate.go b/cmd/nvidia-ctk/cdi/generate/generate.go index 66fc32dd..015ec04d 100644 --- a/cmd/nvidia-ctk/cdi/generate/generate.go +++ b/cmd/nvidia-ctk/cdi/generate/generate.go @@ -234,7 +234,7 @@ func (m command) generateSpec(driverRoot string, nvidiaCTKPath string, namer dev allEdits := edits.NewContainerEdits() - ipcs, err := NewIPCDiscoverer(m.logger, driverRoot) + ipcs, err := discover.NewIPCDiscoverer(m.logger, driverRoot) if err != nil { return nil, fmt.Errorf("failed to create discoverer for IPC sockets: %v", err) } diff --git a/cmd/nvidia-ctk/cdi/generate/ipc.go b/internal/discover/ipc.go similarity index 89% rename from cmd/nvidia-ctk/cdi/generate/ipc.go rename to internal/discover/ipc.go index 3cd96ed8..22156a7f 100644 --- a/cmd/nvidia-ctk/cdi/generate/ipc.go +++ b/internal/discover/ipc.go @@ -14,17 +14,16 @@ # limitations under the License. **/ -package generate +package discover import ( - "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup" "github.com/sirupsen/logrus" ) // NewIPCDiscoverer creats a discoverer for NVIDIA IPC sockets. -func NewIPCDiscoverer(logger *logrus.Logger, driverRoot string) (discover.Discover, error) { - d := discover.NewMounts( +func NewIPCDiscoverer(logger *logrus.Logger, driverRoot string) (Discover, error) { + d := NewMounts( logger, lookup.NewFileLocator( lookup.WithLogger(logger),