mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 00:08:11 +00:00
Add WithInfoLib option to CDI package
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
ef57c07199
commit
8fc4b9c742
@ -18,6 +18,7 @@ package nvcdi
|
||||
|
||||
import (
|
||||
"github.com/NVIDIA/go-nvlib/pkg/nvlib/device"
|
||||
"github.com/NVIDIA/go-nvlib/pkg/nvlib/info"
|
||||
"github.com/NVIDIA/go-nvml/pkg/nvml"
|
||||
|
||||
"github.com/NVIDIA/nvidia-container-toolkit/internal/logger"
|
||||
@ -34,6 +35,13 @@ func WithDeviceLib(devicelib device.Interface) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithInfoLib sets the info library for CDI spec generation.
|
||||
func WithInfoLib(infolib info.Interface) Option {
|
||||
return func(l *nvcdilib) {
|
||||
l.infolib = infolib
|
||||
}
|
||||
}
|
||||
|
||||
// WithDeviceNamers sets the device namer for the library
|
||||
func WithDeviceNamers(namers ...DeviceNamer) Option {
|
||||
return func(l *nvcdilib) {
|
||||
|
Loading…
Reference in New Issue
Block a user