mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-04-22 07:05:06 +00:00
Remove 'Executable' from config struct member
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
35df24d63a
commit
09d42f0ad9
@ -19,7 +19,7 @@ package discover
|
|||||||
// Config represents the configuration options for discovery
|
// Config represents the configuration options for discovery
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Root string
|
Root string
|
||||||
NVIDIAContainerToolkitCLIExecutablePath string
|
NvidiaCTKPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Device represents a discovered character device.
|
// Device represents a discovered character device.
|
||||||
@ -41,8 +41,9 @@ type Hook struct {
|
|||||||
Args []string
|
Args []string
|
||||||
}
|
}
|
||||||
|
|
||||||
//go:generate moq -stub -out discover_mock.go . Discover
|
|
||||||
// Discover defines an interface for discovering the devices, mounts, and hooks available on a system
|
// Discover defines an interface for discovering the devices, mounts, and hooks available on a system
|
||||||
|
//
|
||||||
|
//go:generate moq -stub -out discover_mock.go . Discover
|
||||||
type Discover interface {
|
type Discover interface {
|
||||||
Devices() ([]Device, error)
|
Devices() ([]Device, error)
|
||||||
Mounts() ([]Mount, error)
|
Mounts() ([]Mount, error)
|
||||||
|
@ -107,7 +107,7 @@ func newCreateDRMByPathSymlinks(logger *logrus.Logger, devices Discover, cfg *Co
|
|||||||
d := drmDevicesByPath{
|
d := drmDevicesByPath{
|
||||||
logger: logger,
|
logger: logger,
|
||||||
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
|
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
|
||||||
nvidiaCTKExecutablePath: cfg.NVIDIAContainerToolkitCLIExecutablePath,
|
nvidiaCTKExecutablePath: cfg.NvidiaCTKPath,
|
||||||
root: cfg.Root,
|
root: cfg.Root,
|
||||||
devicesFrom: devices,
|
devicesFrom: devices,
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ func NewLDCacheUpdateHook(logger *logrus.Logger, mounts Discover, cfg *Config) (
|
|||||||
logger: logger,
|
logger: logger,
|
||||||
mountsFrom: mounts,
|
mountsFrom: mounts,
|
||||||
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
|
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
|
||||||
nvidiaCTKExecutablePath: cfg.NVIDIAContainerToolkitCLIExecutablePath,
|
nvidiaCTKExecutablePath: cfg.NvidiaCTKPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
return &d, nil
|
return &d, nil
|
||||||
|
@ -33,7 +33,7 @@ func TestLDCacheUpdateHook(t *testing.T) {
|
|||||||
|
|
||||||
cfg := Config{
|
cfg := Config{
|
||||||
Root: "/",
|
Root: "/",
|
||||||
NVIDIAContainerToolkitCLIExecutablePath: testNvidiaCTKPath,
|
NvidiaCTKPath: testNvidiaCTKPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
|
@ -40,7 +40,7 @@ func NewCreateSymlinksHook(logger *logrus.Logger, csvFiles []string, mounts Disc
|
|||||||
d := symlinks{
|
d := symlinks{
|
||||||
logger: logger,
|
logger: logger,
|
||||||
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
|
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
|
||||||
nvidiaCTKExecutablePath: cfg.NVIDIAContainerToolkitCLIExecutablePath,
|
nvidiaCTKExecutablePath: cfg.NvidiaCTKPath,
|
||||||
csvFiles: csvFiles,
|
csvFiles: csvFiles,
|
||||||
mountsFrom: mounts,
|
mountsFrom: mounts,
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ func NewCSVModifier(logger *logrus.Logger, cfg *config.Config, ociSpec oci.Spec)
|
|||||||
|
|
||||||
config := &discover.Config{
|
config := &discover.Config{
|
||||||
Root: cfg.NVIDIAContainerCLIConfig.Root,
|
Root: cfg.NVIDIAContainerCLIConfig.Root,
|
||||||
NVIDIAContainerToolkitCLIExecutablePath: cfg.NVIDIACTKConfig.Path,
|
NvidiaCTKPath: cfg.NVIDIACTKConfig.Path,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := checkRequirements(logger, image); err != nil {
|
if err := checkRequirements(logger, image); err != nil {
|
||||||
|
@ -46,7 +46,7 @@ func NewGraphicsModifier(logger *logrus.Logger, cfg *config.Config, ociSpec oci.
|
|||||||
|
|
||||||
config := &discover.Config{
|
config := &discover.Config{
|
||||||
Root: cfg.NVIDIAContainerCLIConfig.Root,
|
Root: cfg.NVIDIAContainerCLIConfig.Root,
|
||||||
NVIDIAContainerToolkitCLIExecutablePath: cfg.NVIDIACTKConfig.Path,
|
NvidiaCTKPath: cfg.NVIDIACTKConfig.Path,
|
||||||
}
|
}
|
||||||
d, err := discover.NewGraphicsDiscoverer(
|
d, err := discover.NewGraphicsDiscoverer(
|
||||||
logger,
|
logger,
|
||||||
|
Loading…
Reference in New Issue
Block a user