mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
FIX: Make isNVIDIAContainerRuntimeHook mode idiomatic
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
b8dd473343
commit
9ce690093d
@ -59,11 +59,12 @@ func (m nvidiaContainerRuntimeHookRemover) Modify(spec *specs.Spec) error {
|
||||
// or nvidia-container-toolkit hook. These are included, for example, by the non-experimental
|
||||
// nvidia-container-runtime or docker when specifying the --gpus flag.
|
||||
func isNVIDIAContainerRuntimeHook(hook *specs.Hook) bool {
|
||||
lookFor := map[string]bool{
|
||||
nvidiaContainerRuntimeHookExecutable: true,
|
||||
nvidiaContainerToolkitExecutable: true,
|
||||
bins := map[string]struct{}{
|
||||
nvidiaContainerRuntimeHookExecutable: {},
|
||||
nvidiaContainerToolkitExecutable: {},
|
||||
}
|
||||
base := filepath.Base(hook.Path)
|
||||
|
||||
return lookFor[base]
|
||||
_, exists := bins[filepath.Base(hook.Path)]
|
||||
|
||||
return exists
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user