mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Expose vendor and class as options
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -26,6 +26,9 @@ import (
|
||||
|
||||
type wrapper struct {
|
||||
Interface
|
||||
|
||||
vendor string
|
||||
class string
|
||||
}
|
||||
|
||||
type nvcdilib struct {
|
||||
@@ -37,6 +40,9 @@ type nvcdilib struct {
|
||||
driverRoot string
|
||||
nvidiaCTKPath string
|
||||
|
||||
vendor string
|
||||
class string
|
||||
|
||||
infolib info.Interface
|
||||
}
|
||||
|
||||
@@ -83,7 +89,12 @@ func New(opts ...Option) Interface {
|
||||
panic("Unknown mode")
|
||||
}
|
||||
|
||||
return &wrapper{Interface: lib}
|
||||
w := wrapper{
|
||||
Interface: lib,
|
||||
vendor: l.vendor,
|
||||
class: l.class,
|
||||
}
|
||||
return &w
|
||||
}
|
||||
|
||||
// GetSpec combines the device specs and common edits from the wrapped Interface to a single spec.Interface.
|
||||
@@ -101,6 +112,8 @@ func (l *wrapper) GetSpec() (spec.Interface, error) {
|
||||
return spec.New(
|
||||
spec.WithDeviceSpecs(deviceSpecs),
|
||||
spec.WithEdits(*edits.ContainerEdits),
|
||||
spec.WithVendor(l.vendor),
|
||||
spec.WithClass(l.class),
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user