Skip to content

Commit dca1785

Browse files
committed
Add WithLinuxDevices Opt
Signed-off-by: Michael Crosby <[email protected]>
1 parent 283d5d9 commit dca1785

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

oci/spec_opts.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,3 +1139,12 @@ func WithAnnotations(annotations map[string]string) SpecOpts {
11391139
return nil
11401140
}
11411141
}
1142+
1143+
// WithLinuxDevices adds the provided linux devices to the spec
1144+
func WithLinuxDevices(devices []specs.LinuxDevice) SpecOpts {
1145+
return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
1146+
setLinux(s)
1147+
s.Linux.Devices = append(s.Linux.Devices, devices...)
1148+
return nil
1149+
}
1150+
}

0 commit comments

Comments
 (0)