Merge pull request #3718 from crosbymichael/devperms

Add spec opts for host device and privileged handling
This commit is contained in:
Michael Crosby
2019-10-11 09:56:14 -04:00
committed by GitHub
5 changed files with 137 additions and 2 deletions

View File

@@ -125,7 +125,7 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
opts = append(opts, oci.WithTTY)
}
if context.Bool("privileged") {
opts = append(opts, oci.WithPrivileged)
opts = append(opts, oci.WithPrivileged, oci.WithAllDevicesAllowed, oci.WithHostDevices)
}
if context.Bool("net-host") {
opts = append(opts, oci.WithHostNamespace(specs.NetworkNamespace), oci.WithHostHostsFile, oci.WithHostResolvconf)