Skip to content

Commit 32c3bd1

Browse files
committed
Fallback to standard CDI modifier when creation of automatic CDI modifier fails
Signed-off-by: Christopher Desiniotis <[email protected]>
1 parent 3158146 commit 32c3bd1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/modifier/cdi.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ func NewCDIModifier(logger logger.Interface, cfg *config.Config, ociSpec oci.Spe
5050
return nil, fmt.Errorf("requesting a CDI device with vendor 'runtime.nvidia.com' is not supported when requesting other CDI devices")
5151
}
5252
if len(automaticDevices) > 0 {
53-
return newAutomaticCDISpecModifier(logger, cfg, automaticDevices)
53+
automaticModifier, err := newAutomaticCDISpecModifier(logger, cfg, automaticDevices)
54+
if err == nil {
55+
return automaticModifier, nil
56+
}
57+
logger.Warningf("Failed to create the automatic CDI modifier: %w", err)
58+
logger.Debugf("Falling back to the standard CDI modifier")
5459
}
5560

5661
return cdi.New(

0 commit comments

Comments
 (0)