mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-25 13:35:00 +00:00
Add ipcMounts type
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
3b8c40c3e6
commit
33c7b056ea
@ -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
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user