Remove 'Executable' from private struct member names

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-01-18 11:43:05 +01:00
parent 09d42f0ad9
commit ebbc47702d
3 changed files with 37 additions and 37 deletions

View File

@ -95,21 +95,21 @@ func NewGraphicsMountsDiscoverer(logger *logrus.Logger, root string) (Discover,
type drmDevicesByPath struct {
None
logger *logrus.Logger
lookup lookup.Locator
nvidiaCTKExecutablePath string
root string
devicesFrom Discover
logger *logrus.Logger
lookup lookup.Locator
nvidiaCTKPath string
root string
devicesFrom Discover
}
// newCreateDRMByPathSymlinks creates a discoverer for a hook to create the by-path symlinks for DRM devices discovered by the specified devices discoverer
func newCreateDRMByPathSymlinks(logger *logrus.Logger, devices Discover, cfg *Config) Discover {
d := drmDevicesByPath{
logger: logger,
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
nvidiaCTKExecutablePath: cfg.NvidiaCTKPath,
root: cfg.Root,
devicesFrom: devices,
logger: logger,
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
nvidiaCTKPath: cfg.NvidiaCTKPath,
root: cfg.Root,
devicesFrom: devices,
}
return &d
@ -133,13 +133,13 @@ func (d drmDevicesByPath) Hooks() ([]Hook, error) {
}
hookPath := nvidiaCTKDefaultFilePath
targets, err := d.lookup.Locate(d.nvidiaCTKExecutablePath)
targets, err := d.lookup.Locate(d.nvidiaCTKPath)
if err != nil {
d.logger.Warnf("Failed to locate %v: %v", d.nvidiaCTKExecutablePath, err)
d.logger.Warnf("Failed to locate %v: %v", d.nvidiaCTKPath, err)
} else if len(targets) == 0 {
d.logger.Warnf("%v not found", d.nvidiaCTKExecutablePath)
d.logger.Warnf("%v not found", d.nvidiaCTKPath)
} else {
d.logger.Debugf("Found %v candidates: %v", d.nvidiaCTKExecutablePath, targets)
d.logger.Debugf("Found %v candidates: %v", d.nvidiaCTKPath, targets)
hookPath = targets[0]
}
d.logger.Debugf("Using NVIDIA Container Toolkit CLI path %v", hookPath)

View File

@ -29,10 +29,10 @@ import (
// NewLDCacheUpdateHook creates a discoverer that updates the ldcache for the specified mounts. A logger can also be specified
func NewLDCacheUpdateHook(logger *logrus.Logger, mounts Discover, cfg *Config) (Discover, error) {
d := ldconfig{
logger: logger,
mountsFrom: mounts,
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
nvidiaCTKExecutablePath: cfg.NvidiaCTKPath,
logger: logger,
mountsFrom: mounts,
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
nvidiaCTKPath: cfg.NvidiaCTKPath,
}
return &d, nil
@ -44,10 +44,10 @@ const (
type ldconfig struct {
None
logger *logrus.Logger
mountsFrom Discover
lookup lookup.Locator
nvidiaCTKExecutablePath string
logger *logrus.Logger
mountsFrom Discover
lookup lookup.Locator
nvidiaCTKPath string
}
// Hooks checks the required mounts for libraries and returns a hook to update the LDcache for the discovered paths.
@ -57,7 +57,7 @@ func (d ldconfig) Hooks() ([]Hook, error) {
return nil, fmt.Errorf("failed to discover mounts for ldcache update: %v", err)
}
h := CreateLDCacheUpdateHook(
d.nvidiaCTKExecutablePath,
d.nvidiaCTKPath,
getLibraryPaths(mounts),
)
return []Hook{h}, nil

View File

@ -28,21 +28,21 @@ import (
type symlinks struct {
None
logger *logrus.Logger
lookup lookup.Locator
nvidiaCTKExecutablePath string
csvFiles []string
mountsFrom Discover
logger *logrus.Logger
lookup lookup.Locator
nvidiaCTKPath string
csvFiles []string
mountsFrom Discover
}
// NewCreateSymlinksHook creates a discoverer for a hook that creates required symlinks in the container
func NewCreateSymlinksHook(logger *logrus.Logger, csvFiles []string, mounts Discover, cfg *Config) (Discover, error) {
d := symlinks{
logger: logger,
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
nvidiaCTKExecutablePath: cfg.NvidiaCTKPath,
csvFiles: csvFiles,
mountsFrom: mounts,
logger: logger,
lookup: lookup.NewExecutableLocator(logger, cfg.Root),
nvidiaCTKPath: cfg.NvidiaCTKPath,
csvFiles: csvFiles,
mountsFrom: mounts,
}
return &d, nil
@ -51,13 +51,13 @@ func NewCreateSymlinksHook(logger *logrus.Logger, csvFiles []string, mounts Disc
// Hooks returns a hook to create the symlinks from the required CSV files
func (d symlinks) Hooks() ([]Hook, error) {
hookPath := nvidiaCTKDefaultFilePath
targets, err := d.lookup.Locate(d.nvidiaCTKExecutablePath)
targets, err := d.lookup.Locate(d.nvidiaCTKPath)
if err != nil {
d.logger.Warnf("Failed to locate %v: %v", d.nvidiaCTKExecutablePath, err)
d.logger.Warnf("Failed to locate %v: %v", d.nvidiaCTKPath, err)
} else if len(targets) == 0 {
d.logger.Warnf("%v not found", d.nvidiaCTKExecutablePath)
d.logger.Warnf("%v not found", d.nvidiaCTKPath)
} else {
d.logger.Debugf("Found %v candidates: %v", d.nvidiaCTKExecutablePath, targets)
d.logger.Debugf("Found %v candidates: %v", d.nvidiaCTKPath, targets)
hookPath = targets[0]
}
d.logger.Debugf("Using NVIDIA Container Toolkit CLI path %v", hookPath)