libcontainer: isolate libcontainer/devices

Move the Device-related types to libcontainer/devices, so that
the package can be used in isolation. Aliases have been created
in libcontainer/configs for backward compatibility.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2020-11-10 10:30:51 +01:00
parent 2b92c25130
commit 677baf22d2
20 changed files with 426 additions and 405 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"strconv"
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/devices"
"github.com/opencontainers/runc/libcontainer/specconv"
"golang.org/x/sys/unix"
)
@@ -30,7 +30,7 @@ type tParam struct {
// it uses a network strategy of just setting a loopback interface
// and the default setup for devices
func newTemplateConfig(p *tParam) *configs.Config {
var allowedDevices []*configs.DeviceRule
var allowedDevices []*devices.DeviceRule
for _, device := range specconv.AllowedDevices {
allowedDevices = append(allowedDevices, &device.DeviceRule)
}