Move IPC discoverer to internal/discover package

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-02-07 12:04:03 +01:00
parent 3f70521a63
commit 3b8c40c3e6
2 changed files with 4 additions and 5 deletions

View File

@ -234,7 +234,7 @@ func (m command) generateSpec(driverRoot string, nvidiaCTKPath string, namer dev
allEdits := edits.NewContainerEdits() allEdits := edits.NewContainerEdits()
ipcs, err := NewIPCDiscoverer(m.logger, driverRoot) ipcs, err := discover.NewIPCDiscoverer(m.logger, driverRoot)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to create discoverer for IPC sockets: %v", err) return nil, fmt.Errorf("failed to create discoverer for IPC sockets: %v", err)
} }

View File

@ -14,17 +14,16 @@
# limitations under the License. # limitations under the License.
**/ **/
package generate package discover
import ( import (
"github.com/NVIDIA/nvidia-container-toolkit/internal/discover"
"github.com/NVIDIA/nvidia-container-toolkit/internal/lookup" "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
// NewIPCDiscoverer creats a discoverer for NVIDIA IPC sockets. // NewIPCDiscoverer creats a discoverer for NVIDIA IPC sockets.
func NewIPCDiscoverer(logger *logrus.Logger, driverRoot string) (discover.Discover, error) { func NewIPCDiscoverer(logger *logrus.Logger, driverRoot string) (Discover, error) {
d := discover.NewMounts( d := NewMounts(
logger, logger,
lookup.NewFileLocator( lookup.NewFileLocator(
lookup.WithLogger(logger), lookup.WithLogger(logger),