diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-14 15:17:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-14 15:17:21 +0100 |
commit | 7ab99227e63bfec734bf2372e80ef5a93dc2ef54 (patch) | |
tree | 4d5cc90840d8a13717891aecadf170533830d117 /libpod | |
parent | 9686216f9d44e1d6b4fa60a5c0866746d1afa60b (diff) | |
parent | 72ab66d88622eadcf7c603aa5e6c0751d72214dc (diff) | |
download | podman-7ab99227e63bfec734bf2372e80ef5a93dc2ef54.tar.gz podman-7ab99227e63bfec734bf2372e80ef5a93dc2ef54.tar.bz2 podman-7ab99227e63bfec734bf2372e80ef5a93dc2ef54.zip |
Merge pull request #12825 from elezar/update-cdi
Update use of CDI API
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal_linux.go | 9 |
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") } } |