mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-25 13:35:00 +00:00
add a warning statement listing unresolved CDI devices
This commit is contained in:
parent
30c0848487
commit
6d3b29f3ca
@ -35,14 +35,17 @@ type fromRegistry struct {
|
|||||||
|
|
||||||
var _ oci.SpecModifier = (*fromRegistry)(nil)
|
var _ oci.SpecModifier = (*fromRegistry)(nil)
|
||||||
|
|
||||||
// Modify applies the mofiications defined by the CDI registry to the incomming OCI spec.
|
// Modify applies the modifications defined by the CDI registry to the incoming OCI spec.
|
||||||
func (m fromRegistry) Modify(spec *specs.Spec) error {
|
func (m fromRegistry) Modify(spec *specs.Spec) error {
|
||||||
if err := m.registry.Refresh(); err != nil {
|
if err := m.registry.Refresh(); err != nil {
|
||||||
m.logger.Debugf("The following error was triggered when refreshing the CDI registry: %v", err)
|
m.logger.Debugf("The following error was triggered when refreshing the CDI registry: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
m.logger.Debugf("Injecting devices using CDI: %v", m.devices)
|
m.logger.Debugf("Injecting devices using CDI: %v", m.devices)
|
||||||
_, err := m.registry.InjectDevices(spec, m.devices...)
|
unresolvedDevices, err := m.registry.InjectDevices(spec, m.devices...)
|
||||||
|
if unresolvedDevices != nil {
|
||||||
|
m.logger.Warningf("could not resolve CDI devices: %v", unresolvedDevices)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
var refreshErrors []error
|
var refreshErrors []error
|
||||||
for _, rerrs := range m.registry.GetErrors() {
|
for _, rerrs := range m.registry.GetErrors() {
|
||||||
|
Loading…
Reference in New Issue
Block a user