diff --git a/internal/discover/ipc.go b/internal/discover/ipc.go index 22156a7f..80c5fb7e 100644 --- a/internal/discover/ipc.go +++ b/internal/discover/ipc.go @@ -21,9 +21,11 @@ import ( "github.com/sirupsen/logrus" ) +type ipcMounts mounts + // NewIPCDiscoverer creats a discoverer for NVIDIA IPC sockets. func NewIPCDiscoverer(logger *logrus.Logger, driverRoot string) (Discover, error) { - d := NewMounts( + d := newMounts( logger, lookup.NewFileLocator( lookup.WithLogger(logger), @@ -37,5 +39,14 @@ func NewIPCDiscoverer(logger *logrus.Logger, driverRoot string) (Discover, error }, ) - return d, nil + return (*ipcMounts)(d), nil +} + +func (d *ipcMounts) Mounts() ([]Mount, error) { + mounts, err := (*mounts)(d).Mounts() + if err != nil { + return nil, err + } + + return mounts, nil } diff --git a/internal/discover/mounts.go b/internal/discover/mounts.go index 1c9d27ff..e60ecba0 100644 --- a/internal/discover/mounts.go +++ b/internal/discover/mounts.go @@ -43,6 +43,11 @@ var _ Discover = (*mounts)(nil) // NewMounts creates a discoverer for the required mounts using the specified locator. func NewMounts(logger *logrus.Logger, lookup lookup.Locator, root string, required []string) Discover { + return newMounts(logger, lookup, root, required) +} + +// newMounts creates a discoverer for the required mounts using the specified locator. +func newMounts(logger *logrus.Logger, lookup lookup.Locator, root string, required []string) *mounts { return &mounts{ logger: logger, lookup: lookup,