Skip to content

Commit 8fc4b9c

Browse files
committed
Add WithInfoLib option to CDI package
Signed-off-by: Evan Lezar <[email protected]>
1 parent ef57c07 commit 8fc4b9c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/nvcdi/options.go

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package nvcdi
1818

1919
import (
2020
"github.com/NVIDIA/go-nvlib/pkg/nvlib/device"
21+
"github.com/NVIDIA/go-nvlib/pkg/nvlib/info"
2122
"github.com/NVIDIA/go-nvml/pkg/nvml"
2223

2324
"github.com/NVIDIA/nvidia-container-toolkit/internal/logger"
@@ -34,6 +35,13 @@ func WithDeviceLib(devicelib device.Interface) Option {
3435
}
3536
}
3637

38+
// WithInfoLib sets the info library for CDI spec generation.
39+
func WithInfoLib(infolib info.Interface) Option {
40+
return func(l *nvcdilib) {
41+
l.infolib = infolib
42+
}
43+
}
44+
3745
// WithDeviceNamers sets the device namer for the library
3846
func WithDeviceNamers(namers ...DeviceNamer) Option {
3947
return func(l *nvcdilib) {

0 commit comments

Comments
 (0)