mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Only validate CDI kind if CDI is enabled
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
984189cea4
commit
3ff5a26f5f
@ -260,6 +260,18 @@ func (t *Installer) ValidateOptions(opts *Options) error {
|
|||||||
opts.CDI.Enabled = false
|
opts.CDI.Enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if opts.CDI.Enabled {
|
||||||
|
vendor, class := parser.ParseQualifier(opts.CDI.kind)
|
||||||
|
if err := parser.ValidateVendorName(vendor); err != nil {
|
||||||
|
return fmt.Errorf("invalid CDI vendor name: %v", err)
|
||||||
|
}
|
||||||
|
if err := parser.ValidateClassName(class); err != nil {
|
||||||
|
return fmt.Errorf("invalid CDI class name: %v", err)
|
||||||
|
}
|
||||||
|
opts.CDI.vendor = vendor
|
||||||
|
opts.CDI.class = class
|
||||||
|
}
|
||||||
|
|
||||||
isDisabled := false
|
isDisabled := false
|
||||||
for _, mode := range opts.createDeviceNodes.Value() {
|
for _, mode := range opts.createDeviceNodes.Value() {
|
||||||
if mode != "" && mode != "none" && mode != "control" {
|
if mode != "" && mode != "none" && mode != "control" {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user