pkg/cri/server: don't import libcontainer/configs

Looks like this import was not needed for the test; simplified the test
by just using the device-path (a counter would work, but for debugging,
having the list of paths can be useful).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-11-10 10:33:24 +01:00
parent ccde82da2b
commit 54cc3483ff
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -31,7 +31,6 @@ import (
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/oci"
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
libcontainerconfigs "github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/devices"
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/selinux/go-selinux"
@ -1346,11 +1345,11 @@ func TestPrivilegedDevices(t *testing.T) {
hostDevicesRaw, err := devices.HostDevices()
assert.NoError(t, err)
var hostDevices []*libcontainerconfigs.Device
var hostDevices = make([]string, 0)
for _, dev := range hostDevicesRaw {
// https://github.com/containerd/cri/pull/1521#issuecomment-652807951
if dev.DeviceRule.Major != 0 {
hostDevices = append(hostDevices, dev)
hostDevices = append(hostDevices, dev.Path)
}
}