Skip to content

Commit

Permalink
Merge pull request #43053 from thaJeztah/use_containerd_oci_devices
Browse files Browse the repository at this point in the history
daemon.WithDevices(): use containerd's HostDevices()
  • Loading branch information
thaJeztah committed Jan 5, 2022
2 parents 520dfc3 + 9d9b8e0 commit 6faceab
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions daemon/oci_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/moby/sys/mount"
"github.com/moby/sys/mountinfo"
"github.com/opencontainers/runc/libcontainer/cgroups"
"github.com/opencontainers/runc/libcontainer/devices"
"github.com/opencontainers/runc/libcontainer/user"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
Expand Down Expand Up @@ -874,13 +873,11 @@ func WithDevices(daemon *Daemon, c *container.Container) coci.SpecOpts {
devPermissions := s.Linux.Resources.Devices

if c.HostConfig.Privileged && !userns.RunningInUserNS() {
hostDevices, err := devices.HostDevices()
hostDevices, err := coci.HostDevices()
if err != nil {
return err
}
for _, d := range hostDevices {
devs = append(devs, oci.Device(d))
}
devs = append(devs, hostDevices...)

// adding device mappings in privileged containers
for _, deviceMapping := range c.HostConfig.Devices {
Expand Down

0 comments on commit 6faceab

Please sign in to comment.