Skip to content

Commit 7fba862

Browse files
committed
Fix dir support for devices V3 (containerd#4847)
Signed-off-by: Alexandre Peixoto Ferreira <[email protected]>
1 parent 218db0f commit 7fba862

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
@@ -46,13 +46,13 @@ func WithDevices(devicePath, containerPath, permissions string) SpecOpts {
4646
if err != nil {
4747
return err
4848
}
49-
for _, dev := range devs {
50-
s.Linux.Devices = append(s.Linux.Devices, dev)
49+
for i := range devs {
50+
s.Linux.Devices = append(s.Linux.Devices, devs[i])
5151
s.Linux.Resources.Devices = append(s.Linux.Resources.Devices, specs.LinuxDeviceCgroup{
5252
Allow: true,
53-
Type: dev.Type,
54-
Major: &dev.Major,
55-
Minor: &dev.Minor,
53+
Type: devs[i].Type,
54+
Major: &devs[i].Major,
55+
Minor: &devs[i].Minor,
5656
Access: permissions,
5757
})
5858
}

0 commit comments

Comments
 (0)