aboutsummaryrefslogtreecommitdiff
path: root/libpod/container_internal_linux.go
diff options
context:
space:
mode:
authorEvan Lezar <elezar@nvidia.com>2022-01-12 14:22:29 +0100
committerEvan Lezar <elezar@nvidia.com>2022-01-14 13:35:22 +0100
commit968deb7c2cd2e4fab7edf03f2a73fb62bb652171 (patch)
treeea0349b4a36a44625e5f6dda891034986da8417f /libpod/container_internal_linux.go
parent2c510146aa03c74fb00a15bcf81c62b14df9c7ea (diff)
downloadpodman-968deb7c2cd2e4fab7edf03f2a73fb62bb652171.tar.gz
podman-968deb7c2cd2e4fab7edf03f2a73fb62bb652171.tar.bz2
podman-968deb7c2cd2e4fab7edf03f2a73fb62bb652171.zip
Use new CDI API
This change updates the CDI API to commit 46367ec063fda9da931d050b308ccd768e824364 which addresses some inconistencies in the previous implementation. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r--libpod/container_internal_linux.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 28cc2c621..508a8a8cf 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -22,7 +22,7 @@ import (
metadata "github.com/checkpoint-restore/checkpointctl/lib"
"github.com/checkpoint-restore/go-criu/v5/stats"
- cdi "github.com/container-orchestrated-devices/container-device-interface/pkg"
+ cdi "github.com/container-orchestrated-devices/container-device-interface/pkg/cdi"
"github.com/containernetworking/plugins/pkg/ns"
"github.com/containers/buildah/pkg/chrootuser"
"github.com/containers/buildah/pkg/overlay"
@@ -744,7 +744,12 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
// Warning: CDI may alter g.Config in place.
if len(c.config.CDIDevices) > 0 {
- if err = cdi.UpdateOCISpecForDevices(g.Config, c.config.CDIDevices); err != nil {
+ registry := cdi.GetRegistry()
+ if errs := registry.GetErrors(); len(errs) > 0 {
+ logrus.Debugf("The following errors were triggered when creating the CDI registry: %v", errs)
+ }
+ _, err := registry.InjectDevices(g.Config, c.config.CDIDevices...)
+ if err != nil {
return nil, errors.Wrapf(err, "error setting up CDI devices")
}
}