Skip to content

Commit 6b6914f

Browse files
committed
fix: Use driver.Root instead of config option in modifier Factory
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 17052d8 commit 6b6914f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/modifier/csv_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ func TestNewCSVModifier(t *testing.T) {
117117
devRoot = filepath.Join(lookupRoot, tc.devRootfs)
118118
}
119119
driver := root.New(root.WithDriverRoot(driverRoot), root.WithDevRoot(devRoot))
120-
// TODO: We should point to the factory root here.
121-
tc.cfg.NVIDIAContainerCLIConfig.Root = driverRoot
122120
// Override the CSV file search path for this root.
123121
tc.cfg.NVIDIAContainerRuntimeConfig.Modes.CSV.MountSpecPath = filepath.Join(driverRoot, "/etc/nvidia-container-runtime/host-files-for-container.d")
124122
tc.cfg.NVIDIACTKConfig.Path = "/usr/bin/nvidia-cdi-hook"

internal/modifier/factory.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ func createFactory(opts ...Option) *Factory {
6262
for _, opt := range opts {
6363
opt(f)
6464
}
65-
6665
if f.editsFactory == nil {
6766
f.editsFactory = edits.NewFactory(edits.WithLogger(f.logger))
6867
}
@@ -71,6 +70,9 @@ func createFactory(opts ...Option) *Factory {
7170
}
7271

7372
func (f *Factory) validate() error {
73+
if f.driver == nil {
74+
return fmt.Errorf("a driver must be specified")
75+
}
7476
switch string(f.runtimeMode) {
7577
case "":
7678
return fmt.Errorf("a mode must be specified")

0 commit comments

Comments
 (0)