Skip to content

Commit 0ca2e27

Browse files
committed
Fix dir support for devices V3 (#4847)
Signed-off-by: Alexandre Peixoto Ferreira <[email protected]> (cherry picked from commit 7fba862)
1 parent 84cfadf commit 0ca2e27

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

oci/spec_opts_linux.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ func WithDevices(devicePath, containerPath, permissions string) SpecOpts {
4848
if err != nil {
4949
return err
5050
}
51-
for _, dev := range devs {
52-
s.Linux.Devices = append(s.Linux.Devices, dev)
51+
for i := range devs {
52+
s.Linux.Devices = append(s.Linux.Devices, devs[i])
5353
s.Linux.Resources.Devices = append(s.Linux.Resources.Devices, specs.LinuxDeviceCgroup{
5454
Allow: true,
55-
Type: dev.Type,
56-
Major: &dev.Major,
57-
Minor: &dev.Minor,
55+
Type: devs[i].Type,
56+
Major: &devs[i].Major,
57+
Minor: &devs[i].Minor,
5858
Access: permissions,
5959
})
6060
}

0 commit comments

Comments
 (0)