From 54cc3483ff687acb7d455ca962f1c7a97f7e5c45 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 10 Nov 2020 10:33:24 +0100 Subject: [PATCH] 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 --- pkg/cri/server/container_create_linux_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/cri/server/container_create_linux_test.go b/pkg/cri/server/container_create_linux_test.go index 538f8efb2..46fab532b 100644 --- a/pkg/cri/server/container_create_linux_test.go +++ b/pkg/cri/server/container_create_linux_test.go @@ -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) } }