Merge branch 'fix-nvcdi-constructor' into 'main'

fix: apply options when constructing an instance of the nvcdi library

See merge request nvidia/container-toolkit/container-toolkit!294
This commit is contained in:
Evan Lezar 2023-02-15 08:13:19 +00:00
commit b4ab95f00c

View File

@ -37,6 +37,9 @@ type nvcdilib struct {
// New creates a new nvcdi library // New creates a new nvcdi library
func New(opts ...Option) Interface { func New(opts ...Option) Interface {
l := &nvcdilib{} l := &nvcdilib{}
for _, opt := range opts {
opt(l)
}
if l.nvmllib == nil { if l.nvmllib == nil {
l.nvmllib = nvml.New() l.nvmllib = nvml.New()