mirror of
				https://github.com/NVIDIA/nvidia-container-toolkit
				synced 2025-06-26 18:18:24 +00:00 
			
		
		
		
	Fix typo in variable name
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
		
							parent
							
								
									d0608844dc
								
							
						
					
					
						commit
						282a2c145e
					
				| @ -70,8 +70,8 @@ func (m nvidiaContainerRuntimeHookRemover) Modify(spec *specs.Spec) error { | |||||||
| // nvidia-container-runtime or docker when specifying the --gpus flag.
 | // nvidia-container-runtime or docker when specifying the --gpus flag.
 | ||||||
| func isNVIDIAContainerRuntimeHook(hook *specs.Hook) bool { | func isNVIDIAContainerRuntimeHook(hook *specs.Hook) bool { | ||||||
| 	lookFor := map[string]bool{ | 	lookFor := map[string]bool{ | ||||||
| 		nvidiaContainerRuntimeHookExecuable: true, | 		nvidiaContainerRuntimeHookExecutable: true, | ||||||
| 		nvidiaContainerToolkitExecutable:    true, | 		nvidiaContainerToolkitExecutable:     true, | ||||||
| 	} | 	} | ||||||
| 	base := filepath.Base(hook.Path) | 	base := filepath.Base(hook.Path) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -27,7 +27,7 @@ import ( | |||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| const ( | const ( | ||||||
| 	nvidiaContainerRuntimeHookExecuable   = "nvidia-container-runtime-hook" | 	nvidiaContainerRuntimeHookExecutable  = "nvidia-container-runtime-hook" | ||||||
| 	nvidiaContainerRuntimeHookDefaultPath = "/usr/bin/nvidia-container-runtime-hook" | 	nvidiaContainerRuntimeHookDefaultPath = "/usr/bin/nvidia-container-runtime-hook" | ||||||
| 
 | 
 | ||||||
| 	nvidiaContainerToolkitExecutable = "nvidia-container-toolkit" | 	nvidiaContainerToolkitExecutable = "nvidia-container-toolkit" | ||||||
| @ -50,7 +50,7 @@ type stableRuntimeModifier struct { | |||||||
| // Modify applies the required modification to the incoming OCI spec, inserting the nvidia-container-runtime-hook
 | // Modify applies the required modification to the incoming OCI spec, inserting the nvidia-container-runtime-hook
 | ||||||
| // as a prestart hook.
 | // as a prestart hook.
 | ||||||
| func (m stableRuntimeModifier) Modify(spec *specs.Spec) error { | func (m stableRuntimeModifier) Modify(spec *specs.Spec) error { | ||||||
| 	path, err := exec.LookPath(nvidiaContainerRuntimeHookExecuable) | 	path, err := exec.LookPath(nvidiaContainerRuntimeHookExecutable) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		path = nvidiaContainerRuntimeHookDefaultPath | 		path = nvidiaContainerRuntimeHookDefaultPath | ||||||
| 		_, err = os.Stat(path) | 		_, err = os.Stat(path) | ||||||
| @ -66,7 +66,7 @@ func (m stableRuntimeModifier) Modify(spec *specs.Spec) error { | |||||||
| 		spec.Hooks = &specs.Hooks{} | 		spec.Hooks = &specs.Hooks{} | ||||||
| 	} else if len(spec.Hooks.Prestart) != 0 { | 	} else if len(spec.Hooks.Prestart) != 0 { | ||||||
| 		for _, hook := range spec.Hooks.Prestart { | 		for _, hook := range spec.Hooks.Prestart { | ||||||
| 			if strings.Contains(hook.Path, nvidiaContainerRuntimeHookExecuable) { | 			if strings.Contains(hook.Path, nvidiaContainerRuntimeHookExecutable) { | ||||||
| 				m.logger.Infof("existing nvidia prestart hook found in OCI spec") | 				m.logger.Infof("existing nvidia prestart hook found in OCI spec") | ||||||
| 				return nil | 				return nil | ||||||
| 			} | 			} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user