Move modifier code for inserting nvidia-container-runtime-hook to separate package

This change moves the code defining the insertion of the nvidia-container-runtime
hook to a separate package. This allows for better distinction between the existing
and experimental modifications.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2022-02-22 16:09:45 +02:00
parent 4177fddcc4
commit c6dfc1027d
7 changed files with 233 additions and 231 deletions

View File

@@ -10,6 +10,7 @@ import (
"strings"
"testing"
"github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-container-runtime/modifier"
"github.com/NVIDIA/nvidia-container-toolkit/internal/test"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/require"
@@ -170,7 +171,7 @@ func TestDuplicateHook(t *testing.T) {
// addNVIDIAHook is a basic wrapper for an addHookModifier that is used for
// testing.
func addNVIDIAHook(spec *specs.Spec) error {
m := addHookModifier{logger: logger.Logger}
m := modifier.NewStableRuntimeModifier(logger.Logger)
return m.Modify(spec)
}