mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-02-16 17:42:20 +00:00
FIX: Don't log that hooks is being removed if it is not
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
8db287af8b
commit
e6730fd0f0
@ -42,12 +42,16 @@ func (m nvidiaContainerRuntimeHookRemover) Modify(spec *specs.Spec) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(spec.Hooks.Prestart) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var updateRequired bool
|
var updateRequired bool
|
||||||
newPrestart := make([]specs.Hook, 0, len(spec.Hooks.Prestart))
|
newPrestart := make([]specs.Hook, 0, len(spec.Hooks.Prestart))
|
||||||
|
|
||||||
for _, hook := range spec.Hooks.Prestart {
|
for _, hook := range spec.Hooks.Prestart {
|
||||||
if isNVIDIAContainerRuntimeHook(&hook) {
|
if isNVIDIAContainerRuntimeHook(&hook) {
|
||||||
m.logger.Infof("Removing hook %v", hook)
|
m.logger.Warnf("Found existing NVIDIA Container Runtime Hook: %v", hook)
|
||||||
updateRequired = true
|
updateRequired = true
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user