mirror of
				https://github.com/NVIDIA/nvidia-container-toolkit
				synced 2025-06-26 18:18:24 +00:00 
			
		
		
		
	Remove 'Executable' from private struct member names
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
		
							parent
							
								
									09d42f0ad9
								
							
						
					
					
						commit
						ebbc47702d
					
				| @ -95,21 +95,21 @@ func NewGraphicsMountsDiscoverer(logger *logrus.Logger, root string) (Discover, | |||||||
| 
 | 
 | ||||||
| type drmDevicesByPath struct { | type drmDevicesByPath struct { | ||||||
| 	None | 	None | ||||||
| 	logger                  *logrus.Logger | 	logger        *logrus.Logger | ||||||
| 	lookup                  lookup.Locator | 	lookup        lookup.Locator | ||||||
| 	nvidiaCTKExecutablePath string | 	nvidiaCTKPath string | ||||||
| 	root                    string | 	root          string | ||||||
| 	devicesFrom             Discover | 	devicesFrom   Discover | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // newCreateDRMByPathSymlinks creates a discoverer for a hook to create the by-path symlinks for DRM devices discovered by the specified devices discoverer
 | // 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 { | func newCreateDRMByPathSymlinks(logger *logrus.Logger, devices Discover, cfg *Config) Discover { | ||||||
| 	d := drmDevicesByPath{ | 	d := drmDevicesByPath{ | ||||||
| 		logger:                  logger, | 		logger:        logger, | ||||||
| 		lookup:                  lookup.NewExecutableLocator(logger, cfg.Root), | 		lookup:        lookup.NewExecutableLocator(logger, cfg.Root), | ||||||
| 		nvidiaCTKExecutablePath: cfg.NvidiaCTKPath, | 		nvidiaCTKPath: cfg.NvidiaCTKPath, | ||||||
| 		root:                    cfg.Root, | 		root:          cfg.Root, | ||||||
| 		devicesFrom:             devices, | 		devicesFrom:   devices, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return &d | 	return &d | ||||||
| @ -133,13 +133,13 @@ func (d drmDevicesByPath) Hooks() ([]Hook, error) { | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	hookPath := nvidiaCTKDefaultFilePath | 	hookPath := nvidiaCTKDefaultFilePath | ||||||
| 	targets, err := d.lookup.Locate(d.nvidiaCTKExecutablePath) | 	targets, err := d.lookup.Locate(d.nvidiaCTKPath) | ||||||
| 	if err != nil { | 	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 { | 	} else if len(targets) == 0 { | ||||||
| 		d.logger.Warnf("%v not found", d.nvidiaCTKExecutablePath) | 		d.logger.Warnf("%v not found", d.nvidiaCTKPath) | ||||||
| 	} else { | 	} else { | ||||||
| 		d.logger.Debugf("Found %v candidates: %v", d.nvidiaCTKExecutablePath, targets) | 		d.logger.Debugf("Found %v candidates: %v", d.nvidiaCTKPath, targets) | ||||||
| 		hookPath = targets[0] | 		hookPath = targets[0] | ||||||
| 	} | 	} | ||||||
| 	d.logger.Debugf("Using NVIDIA Container Toolkit CLI path %v", hookPath) | 	d.logger.Debugf("Using NVIDIA Container Toolkit CLI path %v", hookPath) | ||||||
|  | |||||||
| @ -29,10 +29,10 @@ import ( | |||||||
| // NewLDCacheUpdateHook creates a discoverer that updates the ldcache for the specified mounts. A logger can also be specified
 | // 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) { | func NewLDCacheUpdateHook(logger *logrus.Logger, mounts Discover, cfg *Config) (Discover, error) { | ||||||
| 	d := ldconfig{ | 	d := ldconfig{ | ||||||
| 		logger:                  logger, | 		logger:        logger, | ||||||
| 		mountsFrom:              mounts, | 		mountsFrom:    mounts, | ||||||
| 		lookup:                  lookup.NewExecutableLocator(logger, cfg.Root), | 		lookup:        lookup.NewExecutableLocator(logger, cfg.Root), | ||||||
| 		nvidiaCTKExecutablePath: cfg.NvidiaCTKPath, | 		nvidiaCTKPath: cfg.NvidiaCTKPath, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return &d, nil | 	return &d, nil | ||||||
| @ -44,10 +44,10 @@ const ( | |||||||
| 
 | 
 | ||||||
| type ldconfig struct { | type ldconfig struct { | ||||||
| 	None | 	None | ||||||
| 	logger                  *logrus.Logger | 	logger        *logrus.Logger | ||||||
| 	mountsFrom              Discover | 	mountsFrom    Discover | ||||||
| 	lookup                  lookup.Locator | 	lookup        lookup.Locator | ||||||
| 	nvidiaCTKExecutablePath string | 	nvidiaCTKPath string | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // Hooks checks the required mounts for libraries and returns a hook to update the LDcache for the discovered paths.
 | // 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) | 		return nil, fmt.Errorf("failed to discover mounts for ldcache update: %v", err) | ||||||
| 	} | 	} | ||||||
| 	h := CreateLDCacheUpdateHook( | 	h := CreateLDCacheUpdateHook( | ||||||
| 		d.nvidiaCTKExecutablePath, | 		d.nvidiaCTKPath, | ||||||
| 		getLibraryPaths(mounts), | 		getLibraryPaths(mounts), | ||||||
| 	) | 	) | ||||||
| 	return []Hook{h}, nil | 	return []Hook{h}, nil | ||||||
|  | |||||||
| @ -28,21 +28,21 @@ import ( | |||||||
| 
 | 
 | ||||||
| type symlinks struct { | type symlinks struct { | ||||||
| 	None | 	None | ||||||
| 	logger                  *logrus.Logger | 	logger        *logrus.Logger | ||||||
| 	lookup                  lookup.Locator | 	lookup        lookup.Locator | ||||||
| 	nvidiaCTKExecutablePath string | 	nvidiaCTKPath string | ||||||
| 	csvFiles                []string | 	csvFiles      []string | ||||||
| 	mountsFrom              Discover | 	mountsFrom    Discover | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // NewCreateSymlinksHook creates a discoverer for a hook that creates required symlinks in the container
 | // 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) { | func NewCreateSymlinksHook(logger *logrus.Logger, csvFiles []string, mounts Discover, cfg *Config) (Discover, error) { | ||||||
| 	d := symlinks{ | 	d := symlinks{ | ||||||
| 		logger:                  logger, | 		logger:        logger, | ||||||
| 		lookup:                  lookup.NewExecutableLocator(logger, cfg.Root), | 		lookup:        lookup.NewExecutableLocator(logger, cfg.Root), | ||||||
| 		nvidiaCTKExecutablePath: cfg.NvidiaCTKPath, | 		nvidiaCTKPath: cfg.NvidiaCTKPath, | ||||||
| 		csvFiles:                csvFiles, | 		csvFiles:      csvFiles, | ||||||
| 		mountsFrom:              mounts, | 		mountsFrom:    mounts, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return &d, nil | 	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
 | // Hooks returns a hook to create the symlinks from the required CSV files
 | ||||||
| func (d symlinks) Hooks() ([]Hook, error) { | func (d symlinks) Hooks() ([]Hook, error) { | ||||||
| 	hookPath := nvidiaCTKDefaultFilePath | 	hookPath := nvidiaCTKDefaultFilePath | ||||||
| 	targets, err := d.lookup.Locate(d.nvidiaCTKExecutablePath) | 	targets, err := d.lookup.Locate(d.nvidiaCTKPath) | ||||||
| 	if err != nil { | 	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 { | 	} else if len(targets) == 0 { | ||||||
| 		d.logger.Warnf("%v not found", d.nvidiaCTKExecutablePath) | 		d.logger.Warnf("%v not found", d.nvidiaCTKPath) | ||||||
| 	} else { | 	} else { | ||||||
| 		d.logger.Debugf("Found %v candidates: %v", d.nvidiaCTKExecutablePath, targets) | 		d.logger.Debugf("Found %v candidates: %v", d.nvidiaCTKPath, targets) | ||||||
| 		hookPath = targets[0] | 		hookPath = targets[0] | ||||||
| 	} | 	} | ||||||
| 	d.logger.Debugf("Using NVIDIA Container Toolkit CLI path %v", hookPath) | 	d.logger.Debugf("Using NVIDIA Container Toolkit CLI path %v", hookPath) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user