add a warning statement listing unresolved CDI devices

This commit is contained in:
Tariq Ibrahim 2023-08-09 09:00:29 -07:00
parent 30c0848487
commit 6d3b29f3ca

View File

@ -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() {