Update code post codereview
Add specific types for Required and Optional DeviceNodes Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael) Upstream-commit: f042c3c15759fce5cc139f2b3362b791ac7d4829 Component: engine
This commit is contained in:
@@ -101,9 +101,9 @@ func (d *driver) setPrivileged(container *libcontainer.Container) (err error) {
|
||||
container.Cgroups.DeviceAccess = true
|
||||
|
||||
delete(container.Context, "restrictions")
|
||||
delete(container.DeviceNodes, "additional")
|
||||
|
||||
if container.DeviceNodes["required"], err = nodes.GetHostDeviceNodes(); err != nil {
|
||||
container.OptionalDeviceNodes = nil
|
||||
if container.RequiredDeviceNodes, err = nodes.GetHostDeviceNodes(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,9 @@ func New() *libcontainer.Container {
|
||||
Parent: "docker",
|
||||
DeviceAccess: false,
|
||||
},
|
||||
Context: libcontainer.Context{},
|
||||
DeviceNodes: map[string][]string{
|
||||
"required": nodes.DefaultNodes,
|
||||
"additional": {"fuse"},
|
||||
},
|
||||
Context: libcontainer.Context{},
|
||||
RequiredDeviceNodes: nodes.DefaultNodes,
|
||||
OptionalDeviceNodes: []string{"fuse"},
|
||||
}
|
||||
if apparmor.IsEnabled() {
|
||||
container.Context["apparmor_profile"] = "docker-default"
|
||||
|
||||
Reference in New Issue
Block a user