From 7fba862648b2ee70a351441f0e910274937ea04b Mon Sep 17 00:00:00 2001 From: Alexandre Peixoto Ferreira Date: Thu, 19 Aug 2021 07:18:31 -0500 Subject: [PATCH] Fix dir support for devices V3 (#4847) Signed-off-by: Alexandre Peixoto Ferreira --- oci/spec_opts_linux.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/oci/spec_opts_linux.go b/oci/spec_opts_linux.go index b16383c5d..ecf7b022a 100644 --- a/oci/spec_opts_linux.go +++ b/oci/spec_opts_linux.go @@ -46,13 +46,13 @@ func WithDevices(devicePath, containerPath, permissions string) SpecOpts { if err != nil { return err } - for _, dev := range devs { - s.Linux.Devices = append(s.Linux.Devices, dev) + for i := range devs { + s.Linux.Devices = append(s.Linux.Devices, devs[i]) s.Linux.Resources.Devices = append(s.Linux.Resources.Devices, specs.LinuxDeviceCgroup{ Allow: true, - Type: dev.Type, - Major: &dev.Major, - Minor: &dev.Minor, + Type: devs[i].Type, + Major: &devs[i].Major, + Minor: &devs[i].Minor, Access: permissions, }) }