Add linux device options and --devices flag to ctr#3424
Add linux device options and --devices flag to ctr#3424dmcgowan merged 2 commits intocontainerd:masterfrom
Conversation
|
Build succeeded.
|
Signed-off-by: Michael Crosby <[email protected]>
|
Build succeeded.
|
Closes containerd#3066 Signed-off-by: Michael Crosby <[email protected]>
|
Build succeeded.
|
Codecov Report
@@ Coverage Diff @@
## master #3424 +/- ##
==========================================
- Coverage 44.28% 44.06% -0.22%
==========================================
Files 123 124 +1
Lines 13665 13732 +67
==========================================
Hits 6051 6051
- Misses 6683 6750 +67
Partials 931 931
Continue to review full report at Codecov.
|
| opts = append(opts, oci.WithMemoryLimit(limit)) | ||
| } | ||
| for _, dev := range context.StringSlice("device") { | ||
| opts = append(opts, oci.WithLinuxDevice(dev, "rwm")) |
There was a problem hiding this comment.
Consider make device permission as option ?
There was a problem hiding this comment.
it can be added in a follow up if it's important to ppl. ctr is still a dev/testing tool and not a full featured cli
| "golang.org/x/sys/unix" | ||
| ) | ||
|
|
||
| func deviceFromPath(path, permissions string) (*specs.LinuxDevice, error) { |
There was a problem hiding this comment.
I'm not sure we should implement this for non-Linux Unixen
There was a problem hiding this comment.
it should be fine for bsd and such
Closes #3066