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
+5 -5
View File
@@ -7,12 +7,12 @@ import (
"strings"
"testing"
"golang.org/x/sys/unix"
dbus "github.com/godbus/dbus/v5"
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/configs/validate"
"github.com/opencontainers/runc/libcontainer/devices"
"github.com/opencontainers/runtime-spec/specs-go"
"golang.org/x/sys/unix"
)
func TestCreateCommandHookTimeout(t *testing.T) {
@@ -722,13 +722,13 @@ func TestCreateDevices(t *testing.T) {
// Verify that createDevices() deduplicated the /dev/tty entry in the config
for _, configDev := range conf.Devices {
if configDev.Path == "/dev/tty" {
wantDev := &configs.Device{
wantDev := &devices.Device{
Path: "/dev/tty",
FileMode: 0666,
Uid: 1000,
Gid: 1000,
DeviceRule: configs.DeviceRule{
Type: configs.CharDevice,
DeviceRule: devices.DeviceRule{
Type: devices.CharDevice,
Major: 5,
Minor: 0,
},