Skip to content

Commit

Permalink
pkg/cri/server: don't import libcontainer/configs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
thaJeztah committed Feb 4, 2021
1 parent ccde82d commit 54cc348
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/cri/server/container_create_linux_test.go
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 54cc348

Please sign in to comment.