From 6d3b29f3ca95c73b8ec3275613487b77b9b6730c Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Wed, 9 Aug 2023 09:00:29 -0700 Subject: [PATCH] add a warning statement listing unresolved CDI devices --- internal/modifier/cdi/registry.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/modifier/cdi/registry.go b/internal/modifier/cdi/registry.go index ad3666c1..89116f18 100644 --- a/internal/modifier/cdi/registry.go +++ b/internal/modifier/cdi/registry.go @@ -35,14 +35,17 @@ type fromRegistry struct { 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 { 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("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 { var refreshErrors []error for _, rerrs := range m.registry.GetErrors() {